Compare commits

...
Author SHA1 Message Date
Kurt Himebauch f244e284ad fix: scroll one row and move focus together when navigating past the visible grid 2026-10-29 00:00:49 -04:00
Kurt Himebauch 64950099a3 fix(storage): stack the summary card in narrow panes (#1736) 2026-10-28 23:08:59 -04:00
Kurt Himebauch 0516d023fa feat: art-first library cards with a display menu (#1744)
* feat: art-first library cards with a display menu for size, title and storage

* build: use native arm64 docker on Apple Silicon and add a fast deploy loop

* fix: address review feedback on library cards and local build scripts
2026-10-28 22:40:53 -04:00
The412Banner 110cfc28f8 feat: FusionHUD replaces the session HUD, with MangoHud's readings (#1743)
The session HUD is FusionHUD (Bannerlator's HUD) with every reading taken from
the same source, and worked out the same way, as the MangoHud build that runs
Steam's performance overlay in a DroidDeck session.

- gamescope patch 0125 (gamescope-3.16.29-p19) shares the frame times that
  mangoapp reads (one per signalled commit of connector 0) in a ring named by
  DROIDDECK_HUD_FRAMES; the app reads it once per display frame and counts the
  compositor's frames when gamescope sends none.
- MangoHud's rules: FPS over periods of at least 500 ms, frame time = 1000/FPS,
  200-frame graph on a fixed 0-50 ms scale; CPU, GPU, temperatures, RAM, swap,
  VRAM and battery from MangoHud's sources. Zones 22/26/28 are typed as GPU and
  DDR sensors, so Steam's overlay CPU temperature no longer includes them.
- Five sizes in a panel shaped like the DroidDeck mark, with a centred header,
  one left edge, neon outline and FPS; Minimal is the default size. Settings on
  a new "Performance HUD" drawer page, with Bannerlator's options.
- The HUD reads sensors and polls frames only while it is drawn (not while
  hidden, in picture-in-picture or behind another app), keeps its place after
  picture-in-picture, and the diagnostics export has its own reader.

Device-tested on the AYANEO Pocket FIT: same readings as Steam's overlay side
by side in Dead Cells; the HUD updates in a game, hides in picture-in-picture
and comes back in place, no crashes.
2026-10-29 01:53:45 +00:00
devSharaku e871557bf2 Update Xbox backend to 0.2.12 and accept compact JWE tickets (#1729)
Some Microsoft accounts get a delegation-compact (d=) ticket, which the
pinned Xbox backend (Nexus 0.2.8) rejected: the library stayed empty
(store-ticket-format) and downloads failed. This moves the backend to
Nexus 0.2.12, which has the upstream store-ticket fix, rebases the
DroidDeck credentials, launch-view and cloud-token patches, and strips
the d= prefix from compact JWE tickets so downloads work again.

Tested by seven users in the Discord Xbox Store Issues thread on the
pr-1729 build at d55e05a0.

* Update Xbox backend to 0.2.12
* Fix cloud offering fallback and add regression tests
* Fix Xbox authentication with compact JWE tickets
2026-10-29 00:07:53 +00:00
The412Banner a8b3c2d5dc docs(license): name DroidDeck in the GPL notice instead of Pluvia (#1741)
The notice at the end of LICENSE still carried Pluvia's name and
copyright line from GameNative's copy of the file.
2026-10-28 23:56:12 +00:00
Kurt Himebauch 87572a7f91 feat: game page with art backdrop and frosted controls (#1738) 2026-10-28 19:33:33 -04:00
Kurt Himebauch 1e92d10fa5 fix(ui): keep the ring veil count per test (#1739)
* ci: run unit tests in four forks

* fix(ui): keep the ring veil count per test so tests do not share snapshot state

* ci: keep two unit test forks, four were slower
2026-10-28 18:19:15 -04:00
Kurt Himebauch 92787dd0f0 ci: run unit tests in two parallel forks (#1737)
* ci: run unit tests in two forks

* test: start spatial controller mode tests with glasses output selected
2026-10-28 17:35:11 -04:00
Kurt Himebauch aef1f85aa9 ci: run store engine host tests in a parallel job (#1735)
* ci: run store engine host tests in a parallel non-gating job

* ci: harden the store tests job permissions, timeout and exit status
2026-10-28 16:47:42 -04:00
Kurt Himebauch 198f667bf0 feat: add GOG maintenance 2026-10-28 16:10:17 -04:00
Kurt Himebauch 52fa41767c fix: stop stale Android readbacks snapping Steam's brightness slider back (#1731)
* fix: stop stale Android readbacks snapping Steam's brightness slider back during a held stick

* fix: let deploy_fast sign with the release env on macOS and Linux

* fix: honor DROIDDECK_SIGNING_ENV first and cover the env signer in tests

* fix: honor DROIDDECK_SIGNING_ENV first and cover the env signer in tests

* fix: retry held brightness readbacks, use a monotonic hold clock and resolve the signing env path

* fix: resolve the build-tools path before signing changes directory

* fix: pick the newest build-tools numerically and keep the env file from replacing them

* fix: only pick build-tools that have aapt, zipalign and apksigner
2026-10-28 15:25:48 -04:00
Kurt Himebauch 6469a7693c ci: check out without history blobs or the release-note GIFs (#1725) 2026-10-28 13:11:14 -04:00
Kurt Himebauch cd1caf523d Default to Native background behavior and automatic PiP (#1727) 2026-10-28 13:10:08 -04:00
Kurt Himebauch 37e0f30cc6 Reset a game's Wine prefix from Game data (#1724) 2026-10-28 13:09:47 -04:00
Kurt Himebauch 23811147aa Guide the child-process toggle when developer options are off (#1726)
* feat(setup): guide build number and the child-process toggle when developer options are off

* fix(setup): only guide the child-process toggle on devices that have it
2026-10-28 13:01:44 -04:00
160 changed files with 20993 additions and 688 deletions

No files matched your search

+77 -7
View File
@@ -49,6 +49,10 @@ jobs:
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0
sparse-checkout: |
/*
!/docs/releases/media/
sparse-checkout-cone-mode: false
persist-credentials: false
- name: Pin and merge the APK source
id: merge
@@ -82,6 +86,10 @@ jobs:
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0
sparse-checkout: |
/*
!/docs/releases/media/
sparse-checkout-cone-mode: false
persist-credentials: false
- name: Merge the pinned APK base
if: github.event_name == 'pull_request'
@@ -136,6 +144,10 @@ jobs:
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0
sparse-checkout: |
/*
!/docs/releases/media/
sparse-checkout-cone-mode: false
persist-credentials: false
- name: Merge the pinned APK base
if: github.event_name == 'pull_request'
@@ -287,6 +299,10 @@ jobs:
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0
sparse-checkout: |
/*
!/docs/releases/media/
sparse-checkout-cone-mode: false
persist-credentials: false
- name: Check human authorship
@@ -530,13 +546,6 @@ jobs:
git diff --exit-code -- app/src/main/rust/stores/Cargo.lock \
|| { echo "::error::Cargo.lock changed during the build; commit the regenerated lockfile (uploaded as stores-cargo-lock)"; exit 1; }
- name: Store engines host unit tests
timeout-minutes: 10
continue-on-error: true
run: |
cd app/src/main/rust/stores
cargo test --locked 2>&1 | tail -60
- name: Upload the regenerated Cargo.lock
if: failure()
uses: actions/upload-artifact@v4
@@ -626,6 +635,63 @@ jobs:
APK_OUTCOME: ${{ steps.apk-upload.outcome }}
run: bash tools/release/report-build.sh
store-tests:
name: Store engines host tests
needs: source
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
runs-on: ubuntu-24.04
timeout-minutes: 15
continue-on-error: true
permissions:
contents: read
actions: read
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0
sparse-checkout: |
/*
!/docs/releases/media/
sparse-checkout-cone-mode: false
persist-credentials: false
- name: Merge the pinned APK base
if: github.event_name == 'pull_request'
env:
BUILD_BASE_SHA: ${{ needs.source.outputs.base-sha }}
run: |
set -euo pipefail
git fetch --no-tags origin "$BUILD_BASE_SHA"
git config user.name "ci"
git config user.email "ci@users.noreply.github.com"
git merge --no-ff --no-edit FETCH_HEAD
- name: Verify backend and test source match
env:
XBOX_SOURCE_TREE: ${{ needs.source.outputs.tree-sha }}
run: test "$(git rev-parse 'HEAD^{tree}')" = "$XBOX_SOURCE_TREE"
- name: Rust toolchain
id: rust
run: echo "rustc=$(rustc -V | awk '{print $2}')" >> "$GITHUB_OUTPUT"
- name: Cache cargo registry and the host test target
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
app/src/main/rust/stores/target
key: stores-host-v1-${{ runner.os }}-${{ runner.arch }}-${{ steps.rust.outputs.rustc }}-${{ hashFiles('app/src/main/rust/stores/Cargo.lock') }}-${{ hashFiles('app/src/main/rust/stores/src/**', 'app/src/main/rust/stores/Cargo.toml', 'app/src/main/rust/stores/build.rs') }}
restore-keys: |
stores-host-v1-${{ runner.os }}-${{ runner.arch }}-${{ steps.rust.outputs.rustc }}-${{ hashFiles('app/src/main/rust/stores/Cargo.lock') }}-
stores-host-v1-${{ runner.os }}-${{ runner.arch }}-${{ steps.rust.outputs.rustc }}-
- name: Store engines host unit tests
timeout-minutes: 10
continue-on-error: true
run: |
set -o pipefail
cd app/src/main/rust/stores
cargo test --locked 2>&1 | tail -60
python-tests:
name: Python and native regression tests
needs: source
@@ -637,6 +703,10 @@ jobs:
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0
sparse-checkout: |
/*
!/docs/releases/media/
sparse-checkout-cone-mode: false
persist-credentials: false
- name: Merge the pinned APK base
if: github.event_name == 'pull_request'
+3 -3
View File
@@ -631,8 +631,8 @@ to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Pluvia is an unofficial Steam client app for Android
Copyright (C) 2024 Oxters Wyzgowski
DroidDeck brings the SteamOS experience to Android
Copyright (C) 2026 DroidDeck contributors
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Pluvia Copyright (C) 2024 Oxters Wyzgowski
DroidDeck Copyright (C) 2026 DroidDeck contributors
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
+1 -1
View File
@@ -61,7 +61,7 @@ Compatibility and performance vary by device; hardware validation is limited. De
## Credits and licence
GPL-3.0. Runtime, shim, input, and controller work build on WinNative and Bannerlator (maxjivi05). Epic Games and GOG support build on [Phobos’s](https://github.com/phobos665) adaptation of [Legendary](https://github.com/legendary-gl/legendary) and [gogdl](https://github.com/Heroic-Games-Launcher/heroic-gogdl), respectively. Battle.net support is [@kayakyakr](https://github.com/kayakyakr)'s: it runs Blizzard's own Battle.net client, downloaded from Blizzard and not included, in Proton, and shows the key art from each game's [Battle.net Shop](https://shop.battle.net) page; without the Steam client its games see DroidDeck's pad as an Xbox 360 controller through `PROTON_SPOOF_STEAMINPUT_VIDPID` in [Proton](https://github.com/ValveSoftware/wine)'s `dlls/winebus.sys`. Its games install from Stores through Blizzard's own Agent and the local HTTP API it serves, driven the way [@barncastle](https://github.com/barncastle)'s [Battle.Net-Installer](https://github.com/barncastle/Battle.Net-Installer) drives it, with the requests described on [wowdev.wiki](https://wowdev.wiki/Agent); how other launchers find, install and start Blizzard games was read in [@mubaraknumann](https://github.com/mubaraknumann)'s [unifideck](https://github.com/mubaraknumann/unifideck), [@djmittens](https://github.com/djmittens)'s [neo-mittens](https://github.com/djmittens/neo-mittens) `bnetswitch`, [@BCD1210](https://github.com/BCD1210)'s [soju](https://github.com/BCD1210/soju) and [Lutris](https://github.com/lutris/lutris)'s `product.db` reader, without taking their code. The registry entries a GOG game's install script (`goggame-<id>.script`) sets are read the way [Heroic Games Launcher](https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher)'s GOG setup (GPL-3.0) reads them. LSFG frame generation is from the work of Camille LaVey and the [Eden](https://eden-emu.dev) emulator project, following [lsfg-vk](https://github.com/PancakeTAS/lsfg-vk), ported to WinNative and DroidDeck by [@maxjivi05](https://github.com/maxjivi05); it needs your own copy of [Lossless Scaling](https://store.steampowered.com/app/993090/) and ships none of its shaders. x86 AppImages, and any whose own runtime cannot unpack them, are unpacked with [uruntime](https://github.com/VHSgunzo/uruntime) by VHSgunzo (MIT), shipped unmodified with its licence, which also starts the arm64 emulator AppImages whose own runtime cannot run its extractor on Android. x86 AppImages packed with [sharun](https://github.com/VHSgunzo/sharun) by VHSgunzo (MIT) start because DroidDeck's own [FEX](https://github.com/FEX-Emu/FEX) build (MIT) puts the platform name under `AT_PLATFORM`, which sharun's [userland-execve](https://crates.io/crates/userland-execve) loader (MIT) requires; FEX filed it under `AT_BASE_PLATFORM`. The Steam client's audio goes through [@The412Banner](https://github.com/The412Banner)'s [DirectAudio](https://github.com/The412Banner/directaudio) PulseAudio sink (LGPL-2.1-or-later), built from `tools/directaudio/sink` with its request size kept to its ring so clients are not asked to queue 100 ms ahead. mmap ring-buffer controller input was developed by ribbit384 ([WinNative #345](https://github.com/WinNative-Emu/WinNative/pull/345)). Why the x86-64 Steam client refused the arm64 client's sign-in was checked by reading Steam's saved token with the `ConnectCache` format from [deadlock-api-ingest](https://github.com/deadlock-api/deadlock-api-ingest). x86 programs that link OpenSSL 3 under FEX use the copy in the [Steam Linux Runtime 4.0](https://gitlab.steamos.cloud/steamrt/steamrt) platform. Hooks written with `WriteProcessMemory` into code [FEX](https://github.com/FEX-Emu/FEX) has translated go through `/proc/<pid>/mem` again when the kernel refuses `process_vm_writev`, as [Wine](https://gitlab.winehq.org/wine/wine)'s `server/ptrace.c` wrote them before Wine 11. x86 Linux games under FEX get the same `/etc/asound.conf` that [pressure-vessel](https://gitlab.steamos.cloud/steamrt/steam-runtime-tools) writes into the Steam Linux Runtime, so ALSA plays through PulseAudio. Games render with [Mesa](https://gitlab.freedesktop.org/mesa/mesa) Turnip's own per-render-pass choice between tile memory and system memory, while the Steam client keeps `TU_DEBUG=sysmem`; [FEX](https://github.com/FEX-Emu/FEX)'s code disk cache was checked in its source and is already on through Proton. The proot fast path picks the guest name of a host file bound under several names in the order [PRoot](https://github.com/proot-me/proot)'s `path/binding.c` (GPL-2.0-or-later) sorts its bindings, so links and `/proc/self/fd` read back as they do through proot. The session's [PipeWire](https://gitlab.freedesktop.org/pipewire/pipewire) (MIT) opens its sockets with the per-socket access settings documented in its `module-access.c`, and [WirePlumber](https://gitlab.freedesktop.org/pipewire/wireplumber) (MIT) keeps those clients at full permissions through its `access.rules`. Wine write watches use the userfaultLine truncated
GPL-3.0. Runtime, shim, input, and controller work build on WinNative and Bannerlator (maxjivi05). Epic Games and GOG support build on [Phobos’s](https://github.com/phobos665) adaptation of [Legendary](https://github.com/legendary-gl/legendary) and [gogdl](https://github.com/Heroic-Games-Launcher/heroic-gogdl), respectively. Battle.net support is [@kayakyakr](https://github.com/kayakyakr)'s: it runs Blizzard's own Battle.net client, downloaded from Blizzard and not included, in Proton, and shows the key art from each game's [Battle.net Shop](https://shop.battle.net) page; without the Steam client its games see DroidDeck's pad as an Xbox 360 controller through `PROTON_SPOOF_STEAMINPUT_VIDPID` in [Proton](https://github.com/ValveSoftware/wine)'s `dlls/winebus.sys`. Its games install from Stores through Blizzard's own Agent and the local HTTP API it serves, driven the way [@barncastle](https://github.com/barncastle)'s [Battle.Net-Installer](https://github.com/barncastle/Battle.Net-Installer) drives it, with the requests described on [wowdev.wiki](https://wowdev.wiki/Agent); how other launchers find, install and start Blizzard games was read in [@mubaraknumann](https://github.com/mubaraknumann)'s [unifideck](https://github.com/mubaraknumann/unifideck), [@djmittens](https://github.com/djmittens)'s [neo-mittens](https://github.com/djmittens/neo-mittens) `bnetswitch`, [@BCD1210](https://github.com/BCD1210)'s [soju](https://github.com/BCD1210/soju) and [Lutris](https://github.com/lutris/lutris)'s `product.db` reader, without taking their code. The registry entries a GOG game's install script (`goggame-<id>.script`) sets are read the way [Heroic Games Launcher](https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher)'s GOG setup (GPL-3.0) reads them. LSFG frame generation is from the work of Camille LaVey and the [Eden](https://eden-emu.dev) emulator project, following [lsfg-vk](https://github.com/PancakeTAS/lsfg-vk), ported to WinNative and DroidDeck by [@maxjivi05](https://github.com/maxjivi05); it needs your own copy of [Lossless Scaling](https://store.steampowered.com/app/993090/) and ships none of its shaders. x86 AppImages, and any whose own runtime cannot unpack them, are unpacked with [uruntime](https://github.com/VHSgunzo/uruntime) by VHSgunzo (MIT), shipped unmodified with its licence, which also starts the arm64 emulator AppImages whose own runtime cannot run its extractor on Android. x86 AppImages packed with [sharun](https://github.com/VHSgunzo/sharun) by VHSgunzo (MIT) start because DroidDeck's own [FEX](https://github.com/FEX-Emu/FEX) build (MIT) puts the platform name under `AT_PLATFORM`, which sharun's [userland-execve](https://crates.io/crates/userland-execve) loader (MIT) requires; FEX filed it under `AT_BASE_PLATFORM`. The Steam client's audio goes through [@The412Banner](https://github.com/The412Banner)'s [DirectAudio](https://github.com/The412Banner/directaudio) PulseAudio sink (LGPL-2.1-or-later), built from `tools/directaudio/sink` with its request size kept to its ring so clients are not asked to queue 100 ms ahead. The in-game performance HUD is [@The412Banner](https://github.com/The412Banner)'s [FusionHUD](https://github.com/The412Banner/FusionHUD) (GPL-3.0 with an attribution term), Bannerlator's HUD; its frame rate, frame times and readings are taken from the same sources, and worked out the same way, as Valve's [MangoHud](https://github.com/flightlessmango/MangoHud) build (MIT) that runs Steam's performance overlay in a DroidDeck session, with the frame times shared by gamescope patch 0125; when gamescope sends no frames for two seconds, the HUD counts the frames DroidDeck's compositor shows instead, which stop at the screen's refresh rate. mmap ring-buffer controller input was developed by ribbit384 ([WinNative #345](https://github.com/WinNative-Emu/WinNative/pull/345)). Why the x86-64 Steam client refused the arm64 client's sign-in was checked by reading Steam's saved token with the `ConnectCache` format from [deadlock-api-ingest](https://github.com/deadlock-api/deadlock-api-ingest). x86 programs that link OpenSSL 3 under FEX use the copy in the [Steam Linux Runtime 4.0](https://gitlab.steamos.cloud/steamrt/steamrt) platform. Hooks written with `WriteProcessMemory` into code [FEX](https://github.com/FEX-Emu/FEX) has translated go through `/proc/<pid>/mem` again when the kernel refuses `process_vm_writev`, as [Wine](https://gitlab.winehq.org/wine/wine)'s `server/ptrace.c` wrote them before Wine 11. x86 Linux games under FEX get the same `/etc/asound.conf` that [pressure-vessel](https://gitlab.steamos.cloud/steamrt/steam-runtime-tools) writes into the Steam Linux Runtime, so ALSA plays through PulseAudio. Games render with [Mesa](https://gitlab.freedesktop.org/mesa/mesa) Turnip's own per-render-pass choice between tile memory and system memory, while the Steam client keeps `TU_DEBUG=sysmem`; [FEX](https://github.com/FEX-Emu/FEX)'s code disk cache was checked in its source and isLine truncated
XR glasses support builds on WinNative's VITURE glasses work. VITURE protocol details were checked against [XRLinuxDriver](https://github.com/wheaney/XRLinuxDriver) by [@wheaney](https://github.com/wheaney), including the VITURE protocol header it ships, [ar-drivers-rs](https://github.com/badicsalex/ar-drivers-rs) by [@badicsalex](https://github.com/badicsalex) and the [go-macos/iokit VITURE package](https://pkg.go.dev/github.com/go-macos/iokit/viture); the optional VITURE SDK belongs to VITURE and is not included. RayNeo support adapts [@informalTechCode](https://github.com/informalTechCode)'s [RayNeo-Air-Series-3DoF-Scaffold](https://github.com/informalTechCode/RayNeo-Air-Series-3DoF-Scaffold) (Apache-2.0) and references [@verncat](https://github.com/verncat)'s [RayNeo-Air-3S-Pro-OpenVR](https://github.com/verncat/RayNeo-Air-3S-Pro-OpenVR) (MIT) and [Monado](https://gitlab.freedesktop.org/monado/monado) (BSL-1.0); see [docs/third-party/rayneo](docs/third-party/rayneo/README.md). XREAL 1S support references [XRLinuxDriver](https://github.com/wheaney/XRLinuxDriver) and [xrealOneDeviceKit](https://github.com/wheaney/xrealOneDeviceKit) by @wheaney, [xreal_one_driver](https://github.com/rohitsangwan01/xreal_one_driver) by [@rohitsangwan01](https://github.com/rohitsangwan01) (MIT) and [xr-tools](https://github.com/0xcaff/xr-tools) by [@0xcaff](https://github.com/0xcaff). Rokid support follows the Rokid protocol notes in [ar-drivers-rs](https://github.com/badicsalex/ar-drivers-rs) and @badicsalex's [Void Computing write-ups](https://voidcomputing.hu/blog/worse-better-prettier/), and [Monado](https://gitlab.freedesktop.org/monado/monado)'s Rokid driver. The REDMAGIC glasses-display findings draw on [@mekhontsev](https://github.com/mekhontsev)'s [MagicDesk investigation](https://github.com/mekhontsev/magicdesk/blob/main/docs/xr-resolution-fix.md) and [@Coding-BR](https://github.com/Coding-BR)'s [decompiled Nubia kernel](https://github.com/Coding-BR/android_kernel_nubia_sm8850_qwjujube). VITURE, RayNeo, XREAL, Rokid and REDMAGIC are trademarks of their owners; this project is not affiliated with them.
+10
View File
@@ -234,6 +234,7 @@ android {
}
// Robolectric keeps a sandbox per SDK level the tests ask for; seven no longer fit in Gradle's default 512 MB.
maxHeapSize = '2g'
maxParallelForks = 2
def logTarget = providers.systemProperty('robolectric.logging').orNull
if (logTarget != null) systemProperty 'robolectric.logging', logTarget
}
@@ -286,6 +287,13 @@ if (uvcDir) {
}
tasks.named('preBuild').configure { dependsOn(stageRuntimeAssets) }
def stageGogNotices = tasks.register('stageGogNotices', Copy) {
from(layout.projectDirectory.dir('src/main/rust/stores/vendor/xdelta3')) { include 'LICENSE', 'README.droiddeck.md' }
into(layout.buildDirectory.dir('gogNotices/licenses/xdelta3'))
}
android.sourceSets.main.assets.srcDir(layout.buildDirectory.dir('gogNotices'))
tasks.named('preBuild').configure { dependsOn(stageGogNotices) }
def verifyRuntimeInputs = tasks.register('verifyRuntimeInputs', Exec) {
mustRunAfter(stageSessionScripts, stageRuntimeAssets)
workingDir rootProject.projectDir
@@ -303,6 +311,8 @@ def buildRustStores = tasks.register('buildRustStores', Exec) {
description = 'Cross-compiles the store download engines (libdroiddeckstores.so) with cargo-ndk.'
onlyIf { !skipRust }
inputs.dir(rustCrateDir.dir('src'))
inputs.dir(rustCrateDir.dir('vendor'))
inputs.file(rustCrateDir.file('build.rs'))
inputs.files(rustCrateDir.file('Cargo.toml'), rustCrateDir.file('Cargo.lock'))
inputs.property('ndkVersion', android.ndkVersion)
if (!skipRust) inputs.property('rustToolchain', providers.exec {
@@ -33,6 +33,8 @@ add_library(droiddeckwayland SHARED
generated/banner-ahb-v1-protocol.c
src/framegen_bridge.c
src/framegen_jni.c
src/hudframes.c
src/hudframes_jni.c
)
target_compile_options(droiddeckwayland PRIVATE
$<$<COMPILE_LANGUAGE:C>:-Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers>)
@@ -0,0 +1,99 @@
#include <fcntl.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <unistd.h>
#include "hudframes.h"
/* Layout written by gamescope patch 0125 (tools/gamescope/patches). */
#define HUD_FRAMES_MAGIC 0x46484444u
#define HUD_FRAMES_HEADER 128u
#define HUD_FRAMES_ENTRY 16u
struct hud_frames {
const uint8_t *map;
size_t size;
uint64_t seen;
};
static uint32_t load32(const uint8_t *p) { return __atomic_load_n((const uint32_t *)p, __ATOMIC_ACQUIRE); }
static uint64_t load64(const uint8_t *p) { return __atomic_load_n((const uint64_t *)p, __ATOMIC_ACQUIRE); }
struct hud_frames *hud_frames_open(const char *path) {
int fd = open(path, O_RDONLY | O_CLOEXEC);
if (fd < 0) return NULL;
struct stat st;
void *map = MAP_FAILED;
if (fstat(fd, &st) == 0 && st.st_size >= (off_t)HUD_FRAMES_HEADER)
map = mmap(NULL, (size_t)st.st_size, PROT_READ, MAP_SHARED, fd, 0);
close(fd);
if (map == MAP_FAILED) return NULL;
struct hud_frames *h = calloc(1, sizeof(*h));
if (!h) {
munmap(map, (size_t)st.st_size);
return NULL;
}
h->map = map;
h->size = (size_t)st.st_size;
return h;
}
void hud_frames_close(struct hud_frames *h) {
if (!h) return;
munmap((void *)h->map, h->size);
free(h);
}
static uint32_t capacity(const struct hud_frames *h) {
if (load32(h->map) != HUD_FRAMES_MAGIC) return 0;
uint32_t cap;
memcpy(&cap, h->map + 8, 4);
if (cap == 0 || HUD_FRAMES_HEADER + (size_t)cap * HUD_FRAMES_ENTRY > h->size) return 0;
return cap;
}
int hud_frames_poll(struct hud_frames *h, int64_t *frametimes, int64_t *times, int max) {
uint32_t cap = capacity(h);
if (!cap || max <= 0) return -1;
uint64_t count = load64(h->map + 16);
if (count < h->seen) h->seen = 0;
uint64_t from = h->seen;
if (count - from > cap) from = count - cap;
if (count - from > (uint64_t)max) from = count - (uint64_t)max;
int n = 0;
for (uint64_t i = from; i < count; i++, n++) {
const uint8_t *e = h->map + HUD_FRAMES_HEADER + (i % cap) * HUD_FRAMES_ENTRY;
memcpy(&frametimes[n], e, 8);
memcpy(&times[n], e + 8, 8);
}
/* The writer may have lapped the ring while we copied: drop what it overwrote. */
uint64_t after = load64(h->map + 16);
uint64_t valid = after > cap ? after - cap : 0;
if (from < valid) {
int skip = (int)(valid - from < (uint64_t)n ? valid - from : (uint64_t)n);
memmove(frametimes, frametimes + skip, (size_t)(n - skip) * sizeof(int64_t));
memmove(times, times + skip, (size_t)(n - skip) * sizeof(int64_t));
n -= skip;
}
h->seen = count;
return n;
}
int hud_frames_info(const struct hud_frames *h, int32_t *info, char *engine, size_t engine_len) {
if (!capacity(h) || engine_len == 0) return 0;
for (int tries = 0; tries < 8; tries++) {
uint32_t seq = load32(h->map + 24);
if (seq & 1u) continue;
memcpy(&info[0], h->map + 12, 4);
memcpy(&info[1], h->map + 28, 16);
size_t n = engine_len - 1 < 40 ? engine_len - 1 : 40;
memcpy(engine, h->map + 44, n);
engine[n] = '\0';
__atomic_thread_fence(__ATOMIC_ACQUIRE);
if (__atomic_load_n((const uint32_t *)(h->map + 24), __ATOMIC_RELAXED) == seq) return 1;
}
return 0;
}
@@ -0,0 +1,16 @@
#ifndef DROIDDECK_HUDFRAMES_H
#define DROIDDECK_HUDFRAMES_H
#include <stddef.h>
#include <stdint.h>
struct hud_frames;
struct hud_frames *hud_frames_open(const char *path);
void hud_frames_close(struct hud_frames *h);
/* New frames since the last poll, oldest first; -1 while the file holds no valid ring. */
int hud_frames_poll(struct hud_frames *h, int64_t *frametimes, int64_t *times, int max);
/* info: pid, output width, output height, refresh mHz, Steam focused. */
int hud_frames_info(const struct hud_frames *h, int32_t *info, char *engine, size_t engine_len);
#endif
@@ -0,0 +1,55 @@
#include <jni.h>
#include <stdint.h>
#include <stdlib.h>
#include "hudframes.h"
JNIEXPORT jlong JNICALL
Java_com_droiddeck_launcher_hud_HudFrames_nativeOpen(JNIEnv *env, jclass clazz, jstring path) {
(void)clazz;
const char *p = path ? (*env)->GetStringUTFChars(env, path, NULL) : NULL;
if (!p) return 0;
struct hud_frames *h = hud_frames_open(p);
(*env)->ReleaseStringUTFChars(env, path, p);
return (jlong)(intptr_t)h;
}
JNIEXPORT void JNICALL
Java_com_droiddeck_launcher_hud_HudFrames_nativeClose(JNIEnv *env, jclass clazz, jlong handle) {
(void)env; (void)clazz;
hud_frames_close((struct hud_frames *)(intptr_t)handle);
}
JNIEXPORT jint JNICALL
Java_com_droiddeck_launcher_hud_HudFrames_nativePoll(JNIEnv *env, jclass clazz, jlong handle,
jlongArray frametimes, jlongArray times) {
(void)clazz;
struct hud_frames *h = (struct hud_frames *)(intptr_t)handle;
if (!h || !frametimes || !times) return -1;
jsize max = (*env)->GetArrayLength(env, frametimes);
jsize max2 = (*env)->GetArrayLength(env, times);
if (max2 < max) max = max2;
if (max <= 0) return -1;
int64_t *ft = malloc(sizeof(int64_t) * (size_t)max);
int64_t *tm = malloc(sizeof(int64_t) * (size_t)max);
int n = ft && tm ? hud_frames_poll(h, ft, tm, max) : -1;
if (n > 0) {
(*env)->SetLongArrayRegion(env, frametimes, 0, n, (const jlong *)ft);
(*env)->SetLongArrayRegion(env, times, 0, n, (const jlong *)tm);
}
free(ft);
free(tm);
return n;
}
JNIEXPORT jstring JNICALL
Java_com_droiddeck_launcher_hud_HudFrames_nativeInfo(JNIEnv *env, jclass clazz, jlong handle, jintArray info) {
(void)clazz;
const struct hud_frames *h = (const struct hud_frames *)(intptr_t)handle;
if (!h || !info || (*env)->GetArrayLength(env, info) < 5) return NULL;
int32_t values[5];
char engine[41];
if (!hud_frames_info(h, values, engine, sizeof(engine))) return NULL;
(*env)->SetIntArrayRegion(env, info, 0, 5, (const jint *)values);
return (*env)->NewStringUTF(env, engine);
}
@@ -1315,7 +1315,7 @@ class FrontEndActivity : ComponentActivity() {
showPhantomGate = true
},
onStartWirelessAdbPairing = { WirelessAdbPairingService.start(this) },
onStartPairingGuide = { displayId -> PairingGuideActivity.start(this, displayId) },
onStartPairingGuide = { displayId, toggleOnly -> PairingGuideActivity.start(this, displayId, toggleOnly) },
onOpenNotificationSettings = {
startActivity(Intent(android.provider.Settings.ACTION_APP_NOTIFICATION_SETTINGS)
.putExtra(android.provider.Settings.EXTRA_APP_PACKAGE, packageName)
@@ -58,6 +58,7 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import com.droiddeck.launcher.core.AppLanguage
import com.droiddeck.launcher.core.GlobalSettings
import com.droiddeck.launcher.core.PhantomProcessLimit
import com.droiddeck.launcher.core.WirelessAdbPairingService
import com.droiddeck.launcher.core.WirelessAdbPairingService.Stage
import com.droiddeck.launcher.ui.DroidDeckTheme
@@ -67,9 +68,10 @@ import com.droiddeck.launcher.ui.SecondaryButton
import kotlinx.coroutines.delay
class PairingGuideActivity : ComponentActivity() {
enum class Step { BUILD_NUMBER, WIRELESS_DEBUGGING, PAIR, CODE, WORKING, DONE, FAILED }
enum class Step { BUILD_NUMBER, CHILD_PROCESS, WIRELESS_DEBUGGING, PAIR, CODE, WORKING, DONE, FAILED }
private var settingsDisplay: Int? = null
private var toggleOnly = false
private var inPip by mutableStateOf(false)
private var launchPending = false
@@ -78,6 +80,7 @@ class PairingGuideActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
settingsDisplay = intent.getIntExtra(EXTRA_DISPLAY, -1).takeIf { it >= 0 }
toggleOnly = intent.getBooleanExtra(EXTRA_TOGGLE_ONLY, false)
setContent { DroidDeckTheme { Guide() } }
launchPending = savedInstanceState == null
}
@@ -86,6 +89,7 @@ class PairingGuideActivity : ComponentActivity() {
super.onNewIntent(intent)
setIntent(intent)
settingsDisplay = intent.getIntExtra(EXTRA_DISPLAY, -1).takeIf { it >= 0 }
toggleOnly = intent.getBooleanExtra(EXTRA_TOGGLE_ONLY, false)
launchPending = true
}
@@ -108,7 +112,7 @@ class PairingGuideActivity : ComponentActivity() {
private fun launchSettings() {
launchPending = false
openSettings(stepFor(this, WirelessAdbPairingService.stage.value))
openSettings(stepFor(SettingsState.read(this), WirelessAdbPairingService.stage.value, toggleOnly))
}
private fun enterPip() {
@@ -121,7 +125,9 @@ class PairingGuideActivity : ComponentActivity() {
val intent = if (step == Step.BUILD_NUMBER) {
Intent(Settings.ACTION_DEVICE_INFO_SETTINGS).putExtra(HIGHLIGHT_KEY, "build_number")
} else {
Intent(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS).putExtra(HIGHLIGHT_KEY, "toggle_adb_wireless")
Intent(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS).apply {
if (step != Step.CHILD_PROCESS) putExtra(HIGHLIGHT_KEY, "toggle_adb_wireless")
}
}.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
val display = settingsDisplay
runCatching {
@@ -147,10 +153,10 @@ class PairingGuideActivity : ComponentActivity() {
delay(500)
}
}
val step = stepFor(settingsState, stage)
val step = stepFor(settingsState, stage, toggleOnly)
var previous by remember { mutableStateOf(step) }
LaunchedEffect(step) {
if (previous == Step.BUILD_NUMBER && step == Step.WIRELESS_DEBUGGING) openSettings(step)
if (previous == Step.BUILD_NUMBER && (step == Step.WIRELESS_DEBUGGING || step == Step.CHILD_PROCESS)) openSettings(step)
previous = step
when (step) {
Step.DONE -> { delay(1_500); returnToApp() }
@@ -158,7 +164,7 @@ class PairingGuideActivity : ComponentActivity() {
else -> Unit
}
}
LaunchedEffect(stage) { if (stage == Stage.Idle) finish() }
LaunchedEffect(stage) { if (stage == Stage.Idle && !toggleOnly) finish() }
BackHandler(enabled = !inPip && settingsDisplay == null) { enterPip() }
Box(Modifier.fillMaxSize().background(MaterialTheme.colorScheme.background), contentAlignment = Alignment.Center) {
@@ -199,7 +205,7 @@ class PairingGuideActivity : ComponentActivity() {
openSettings(step)
})
SecondaryButton(stringResource(R.string.common_cancel), onClick = {
WirelessAdbPairingService.cancel(this@PairingGuideActivity)
if (!toggleOnly) WirelessAdbPairingService.cancel(this@PairingGuideActivity)
returnToApp()
})
}
@@ -210,6 +216,7 @@ class PairingGuideActivity : ComponentActivity() {
@Composable
private fun instruction(step: Step, stage: Stage): String = when (step) {
Step.BUILD_NUMBER -> stringResource(R.string.pairguide_build_number)
Step.CHILD_PROCESS -> stringResource(R.string.pairguide_child_process)
Step.WIRELESS_DEBUGGING -> stringResource(R.string.pairguide_wireless)
Step.PAIR -> stringResource(R.string.pairguide_pair)
Step.CODE -> (stage as? Stage.CodeNeeded)?.error ?: stringResource(R.string.gate_step3)
@@ -226,6 +233,7 @@ class PairingGuideActivity : ComponentActivity() {
val beat by pulse.animateFloat(0f, 1f, infiniteRepeatable(tween(900, easing = LinearEasing), RepeatMode.Restart), label = "beat")
val label = when (step) {
Step.BUILD_NUMBER -> stringResource(R.string.pairguide_row_build_number)
Step.CHILD_PROCESS -> stringResource(R.string.pairguide_row_child_process)
Step.WIRELESS_DEBUGGING -> stringResource(R.string.pairguide_row_wireless)
Step.PAIR -> stringResource(R.string.pairguide_row_pair)
Step.CODE -> stringResource(R.string.adbpair_enter_code)
@@ -240,7 +248,7 @@ class PairingGuideActivity : ComponentActivity() {
Text(label, style = if (compact) MaterialTheme.typography.labelMedium else MaterialTheme.typography.bodyLarge,
color = colors.onSurface, maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.weight(1f))
when (step) {
Step.WIRELESS_DEBUGGING -> Toggle(on = beat > 0.5f, accent = accent, compact = compact)
Step.WIRELESS_DEBUGGING, Step.CHILD_PROCESS -> Toggle(on = beat > 0.5f, accent = accent, compact = compact)
else -> Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp)) {
if (step == Step.BUILD_NUMBER) Text("×7", style = MaterialTheme.typography.labelLarge, color = accent)
Box(contentAlignment = Alignment.Center) {
@@ -267,7 +275,8 @@ class PairingGuideActivity : ComponentActivity() {
@Composable
private fun StepDots(step: Step) {
val accent = LocalPalette.current.signal
val shown = listOf(Step.BUILD_NUMBER, Step.WIRELESS_DEBUGGING, Step.PAIR, Step.CODE)
val shown = if (toggleOnly) listOf(Step.BUILD_NUMBER, Step.CHILD_PROCESS)
else listOf(Step.BUILD_NUMBER, Step.WIRELESS_DEBUGGING, Step.PAIR, Step.CODE)
val at = shown.indexOf(step).takeIf { it >= 0 } ?: shown.size
Row(horizontalArrangement = Arrangement.spacedBy(5.dp), verticalAlignment = Alignment.CenterVertically) {
shown.forEachIndexed { index, _ ->
@@ -278,22 +287,30 @@ class PairingGuideActivity : ComponentActivity() {
}
}
private data class SettingsState(val developerOptions: Boolean, val wirelessDebugging: Boolean) {
private data class SettingsState(
val developerOptions: Boolean,
val wirelessDebugging: Boolean,
val childProcessBlocked: Boolean,
) {
companion object {
fun read(context: Context) = SettingsState(
GlobalSettings.developerOptionsOn(context),
GlobalSettings.wirelessDebuggingOn(context),
PhantomProcessLimit.blocksSteam(PhantomProcessLimit.read(context)),
)
}
}
companion object {
private const val EXTRA_DISPLAY = "settingsDisplay"
private const val EXTRA_TOGGLE_ONLY = "toggleOnly"
private const val HIGHLIGHT_KEY = ":settings:fragment_args_key"
private fun stepFor(context: Context, stage: Stage) = stepFor(SettingsState.read(context), stage)
private fun stepFor(settings: SettingsState, stage: Stage): Step = when (stage) {
private fun stepFor(settings: SettingsState, stage: Stage, toggleOnly: Boolean): Step = if (toggleOnly) when {
!settings.developerOptions -> Step.BUILD_NUMBER
settings.childProcessBlocked -> Step.CHILD_PROCESS
else -> Step.DONE
} else when (stage) {
is Stage.Working -> Step.WORKING
Stage.Done -> Step.DONE
is Stage.Failed -> Step.FAILED
@@ -317,10 +334,11 @@ class PairingGuideActivity : ComponentActivity() {
return mode == AppOpsManager.MODE_ALLOWED
}
fun start(context: Context, settingsDisplay: Int?): Boolean {
fun start(context: Context, settingsDisplay: Int?, toggleOnly: Boolean = false): Boolean {
if (settingsDisplay == null && !canFloat(context)) return false
context.startActivity(Intent(context, PairingGuideActivity::class.java)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
.putExtra(EXTRA_TOGGLE_ONLY, toggleOnly)
.apply { if (settingsDisplay != null) putExtra(EXTRA_DISPLAY, settingsDisplay) })
return true
}
@@ -90,7 +90,8 @@ import com.droiddeck.launcher.input.TouchscreenGestures
import com.droiddeck.launcher.input.ScrollTouchGestures
import com.droiddeck.launcher.runtime.LinuxRuntime
import com.droiddeck.launcher.session.LoadingState
import com.droiddeck.launcher.session.PerfHud
import com.droiddeck.launcher.hud.FusionHudConfig
import com.droiddeck.launcher.hud.FusionHudHost
import com.droiddeck.launcher.session.PerfMode
import com.droiddeck.launcher.session.SteamRepair
import com.droiddeck.launcher.session.GameEnvironmentStore
@@ -158,7 +159,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
private lateinit var surfaceView: SurfaceView
private lateinit var sessionOverlay: ComposeView
private lateinit var loading: LoadingState
private lateinit var hud: PerfHud
private lateinit var hud: FusionHudHost
private lateinit var memoryHud: com.droiddeck.launcher.session.MemoryHud
private var padBridge: PadBridge? = null
private var joyConVr: com.droiddeck.launcher.input.JoyConVr? = null
@@ -333,9 +334,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
private var achievementsInFront by mutableStateOf<AchievementsInFront?>(null)
private var achievementsOpen by mutableStateOf(false)
private var hudOn by mutableStateOf(true)
private var hudFps by mutableStateOf(true)
private var hudBattery by mutableStateOf(true)
private var hudGraph by mutableStateOf(true)
private var hudConfig by mutableStateOf<Map<String, String>>(emptyMap())
private var hudColor by mutableStateOf(SessionPrefs.HUD_COLOR_MINT)
private var hudOpacity by mutableStateOf(SessionPrefs.HUD_OPACITY_DEFAULT)
private var upscaler by mutableStateOf(0)
@@ -641,7 +640,9 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
val needProton = protonUser && com.droiddeck.launcher.runtime.DesktopCatalog.protonSeedNeeded(this)
if (needRuntime || needResume || needDesktop || needProton) installThenStart(needRuntime, needDesktop, needProton, needResume)
}
hud = PerfHud(this)
hud = FusionHudHost(this)
hud.onConfigChanged = { hudConfig = FusionHudConfig.load(this) }
hud.attach(root, root.childCount)
memoryHud = com.droiddeck.launcher.session.MemoryHud(this)
hud.onPresentingWindowChanged = {
if (FrameGen.engine(this) != FrameGen.ENGINE_OFF) CompositorHost.rearmFrameGen { applyFrameGen() }
@@ -729,6 +730,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
onDispose { com.droiddeck.launcher.glasses.GlassesMenuMirror.setSessionMenuVisible(this@SessionActivity, false) }
}
androidx.compose.runtime.LaunchedEffect(drawerOpen, pcKeyboardOpen, achievementsOpen, pipUi) { updatePointerCapture() }
androidx.compose.runtime.LaunchedEffect(pipUi) { hud.setHidden(pipUi) }
androidx.compose.runtime.LaunchedEffect(AgentGuest.steamKeyboard) { updateOnScreenControls() }
androidx.compose.runtime.LaunchedEffect(picturePosition, SessionState.running, pipUi, cardboard.enabled) { applyGameAlignment() }
DroidDeckTheme {
@@ -744,9 +746,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
com.droiddeck.launcher.ui.FocusGlideHost(androidx.compose.ui.Modifier.fillMaxSize()) {
CursorOverlay({ cursorPos }, cursorVisible, resources.displayMetrics.density,
cursorImage, cursorHotX, cursorHotY, cursorImageScale)
val hudLines = listOf(hud.text, memoryHud.text).filter { it.isNotEmpty() }
if (hudLines.isNotEmpty() || hud.graph.size >= 2)
HudText(hudLines.joinToString("\n"), hud.graph, hudColor, hudOpacity)
if (memoryHud.text.isNotEmpty()) HudText(memoryHud.text, hudColor, hudOpacity)
val phonePanel = glassesOutputActive && !loading.visible && !drawerOpen && !pcKeyboardOpen
if (phonePanel) GlassesPhonePanel(glasses, steamVrStatus == SteamVr.Status.RUNNING, headTracking)
if (trackingRecovery != null && !drawerOpen && !pcKeyboardOpen && !loading.visible) {
@@ -943,11 +943,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
isHomeApp = isHomeApp,
androidApps = androidApps,
hudOn = hudOn,
hudFps = hudFps,
hudBattery = hudBattery,
hudGraph = hudGraph,
hudColor = hudColor,
hudOpacity = hudOpacity,
hudConfig = hudConfig,
upscaler = upscaler, upscaleSharpness = upscaleSharpness,
effects = effects,
cardboard = cardboard,
@@ -978,11 +974,9 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
secondScreenDisplays = secondScreenDisplays,
selectedSecondScreenDisplay = selectedSecondScreenDisplay,
onHud = { on -> SessionPrefs.setHudEnabled(this@SessionActivity, on); hudOn = on; hud.refresh() },
onHudFps = { on -> SessionPrefs.setHudShowFps(this@SessionActivity, on); hudFps = on; hud.refresh() },
onHudBattery = { on -> SessionPrefs.setHudShowBattery(this@SessionActivity, on); hudBattery = on; hud.refresh() },
onHudGraph = { on -> SessionPrefs.setHudShowGraph(this@SessionActivity, on); hudGraph = on; hud.refresh() },
onHudColor = { color -> SessionPrefs.setHudColor(this@SessionActivity, color); hudColor = color },
onHudOpacity = { percent -> SessionPrefs.setHudOpacity(this@SessionActivity, percent); hudOpacity = percent },
onHudSetting = { key, value -> hudConfig = FusionHudConfig.set(this@SessionActivity, key, value); hud.applyConfig() },
onHudReset = { hudConfig = FusionHudConfig.reset(this@SessionActivity); hud.applyConfig() },
onHudExport = { exportHudDiagnostics() },
onUpscaler = { m ->
SessionPrefs.setUpscaler(this@SessionActivity, m); upscaler = m
WaylandCompositor.nativeSetUpscaler(m)
@@ -1604,6 +1598,15 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
else getString(R.string.load_starting_steam)
}
private fun exportHudDiagnostics() {
glassesScope.launch {
val file = kotlinx.coroutines.withContext(kotlinx.coroutines.Dispatchers.IO) { hud.exportDiagnostics() }
android.widget.Toast.makeText(this@SessionActivity,
if (file != null) getString(R.string.hud_export_done, file.path) else getString(R.string.hud_export_failed),
android.widget.Toast.LENGTH_LONG).show()
}
}
private fun shareCurrentSessionLogs() {
val folder = SessionPaths.current() ?: SessionPaths.lastEnded()
if (folder == null || !folder.isDirectory) {
@@ -1629,9 +1632,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
unfoldedControlsWithController = SessionPrefs.unfoldedControlsWithController(this)
picturePosition = SessionPrefs.picturePosition(this)
hudOn = SessionPrefs.hudEnabled(this)
hudFps = SessionPrefs.hudShowFps(this)
hudBattery = SessionPrefs.hudShowBattery(this)
hudGraph = SessionPrefs.hudShowGraph(this)
hudConfig = FusionHudConfig.load(this)
hudColor = SessionPrefs.hudColor(this)
hudOpacity = SessionPrefs.hudOpacity(this)
upscaler = SessionPrefs.upscaler(this)
@@ -3280,6 +3281,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
super.onStart()
if (runtimeRemovalBlocked) return
started = true
if (::hud.isInitialized) hud.setBackgrounded(false)
refreshActivityDisplayId()
displayManager.registerDisplayListener(displayListener, Handler(Looper.getMainLooper()))
for (name in arrayOf("peak_refresh_rate", "min_refresh_rate")) {
@@ -3297,6 +3299,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
override fun onStop() {
if (runtimeRemovalBlocked) { super.onStop(); return }
started = false
if (::hud.isInitialized) hud.setBackgrounded(true)
updateHandCamera()
displayManager.unregisterDisplayListener(displayListener)
contentResolver.unregisterContentObserver(refreshSettingObserver)
@@ -0,0 +1,53 @@
package com.droiddeck.launcher.hud
import android.graphics.Canvas
import android.graphics.Matrix
import android.graphics.Paint
import android.graphics.Path
/** artwork/droiddeck-mark.svg: the split D with its circular cut-out and the blue orb. */
internal object DroidDeckMark {
private const val VIEW_X = -55.98f
const val VIEW_W = 239.92f
const val VIEW_H = 223.72f
private val body: Path by lazy {
val d = Path().apply {
moveTo(-31.98f, 0f)
lineTo(63.97f, 0f)
cubicTo(125.81f, 0f, 175.93f, 50.08f, 175.93f, 111.86f)
cubicTo(175.93f, 173.64f, 125.81f, 223.72f, 63.97f, 223.72f)
lineTo(-31.98f, 223.72f)
close()
}
val cut = Path().apply {
addCircle(63.98f, 111.86f, 71.81f, Path.Direction.CW)
addRect(56.055f, 0f, 71.885f, 45f, Path.Direction.CW)
addRect(56.055f, 178.72f, 71.885f, 223.72f, Path.Direction.CW)
}
d.op(cut, Path.Op.DIFFERENCE)
d.offset(-VIEW_X, 0f)
d
}
private val scaled = Path()
private val matrix = Matrix()
private val paint = Paint(Paint.ANTI_ALIAS_FLAG).apply { style = Paint.Style.FILL }
fun widthFor(height: Float): Float = height * VIEW_W / VIEW_H
/** Where the drawn mark starts and ends inside [widthFor]: the artwork has empty space on both sides. */
fun inkLeftFor(height: Float): Float = (-31.98f - VIEW_X) * height / VIEW_H
fun inkRightFor(height: Float): Float = (175.93f - VIEW_X) * height / VIEW_H
fun draw(canvas: Canvas, left: Float, top: Float, height: Float, bodyColor: Int, orbColor: Int) {
val s = height / VIEW_H
matrix.setScale(s, s)
matrix.postTranslate(left, top)
body.transform(matrix, scaled)
paint.color = bodyColor
canvas.drawPath(scaled, paint)
paint.color = orbColor
canvas.drawCircle(left + (63.98f - VIEW_X) * s, top + 111.86f * s, 55.98f * s, paint)
}
}
@@ -0,0 +1,53 @@
package com.droiddeck.launcher.hud
import android.content.Context
import com.droiddeck.launcher.session.SessionPrefs
/** FusionHUD's settings as one "key=value,…" string (FusionHudView.applyConfig), stored in SessionPrefs. */
internal object FusionHudConfig {
/** Bannerlator's Fusion defaults (DeckOverlaySettings), with the FPS graph from the old DroidDeck HUD. */
val DEFAULTS: Map<String, String> = linkedMapOf(
"hudSize" to "minimal", "hudLocked" to "0", "hudScale" to "100", "hudOpacity" to "80", "hudColor" to "mid",
"hudOutline" to "40", "hudOutlineAccent" to "1",
"showFPS" to "1", "showFPSGraph" to "1", "showCPUUsage" to "1", "showCPULoad" to "1", "showGPULoad" to "1",
"showVram" to "1", "showRAM" to "1", "showPower" to "1", "showTemp" to "1", "showBatteryTemp" to "1",
"showGpuTemp" to "0", "showBattery" to "0", "showLow001" to "1", "fpsDecimal" to "1", "showPerCore" to "1",
"showSwap" to "1", "showNet" to "1", "showResolution" to "1", "showProton" to "1", "showSession" to "1",
"showClock" to "1", "showEngine" to "1", "showRenderer" to "1", "showGpuModel" to "1",
"tempUnit" to "c", "tempBands" to "1", "tempAuto" to "1", "tempRedCpu" to "90", "tempRedGpu" to "90", "tempRedBat" to "48",
)
/** Switches Bannerlator sets together (DeckOverlaySettings twins). */
private val TWINS = mapOf("showCPUUsage" to "showCPULoad", "showTemp" to "showBatteryTemp", "showEngine" to "showRenderer")
fun load(context: Context): MutableMap<String, String> {
val values = LinkedHashMap(DEFAULTS)
val stored = SessionPrefs.fusionHudConfig(context)
if (stored == null) {
values["showFPS"] = flag(SessionPrefs.hudShowFps(context))
values["showFPSGraph"] = flag(SessionPrefs.hudShowGraph(context))
values["hudOpacity"] = SessionPrefs.hudOpacity(context).toString()
} else {
for (entry in KeyValueSet(stored)) if (entry.size == 2 && entry[0] in DEFAULTS) values[entry[0]] = entry[1]
}
return values
}
fun encode(values: Map<String, String>): String = values.entries.joinToString(",") { "${it.key}=${it.value}" }
fun set(context: Context, key: String, value: String): Map<String, String> {
val values = load(context)
if (key !in DEFAULTS) return values
values[key] = value
TWINS[key]?.let { values[it] = value }
SessionPrefs.setFusionHudConfig(context, encode(values))
return values
}
fun reset(context: Context): Map<String, String> {
SessionPrefs.setFusionHudConfig(context, encode(DEFAULTS))
return DEFAULTS
}
private fun flag(on: Boolean) = if (on) "1" else "0"
}
@@ -0,0 +1,232 @@
package com.droiddeck.launcher.hud
import android.content.Context
import android.os.Environment
import android.os.Handler
import android.os.Looper
import android.view.Choreographer
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import com.droiddeck.launcher.gpu.FrameGen
import com.droiddeck.launcher.gpu.GpuInfo
import com.droiddeck.launcher.runtime.LinuxRuntime
import com.droiddeck.launcher.session.SessionPrefs
import com.droiddeck.launcher.wayland.WaylandCompositor
import java.io.File
import kotlin.math.roundToInt
/**
* FusionHUD on the session screen, in place of the old text HUD: the view, the frame feed from gamescope
* (MangoHud's frame times) and MangoHud's readings, started with the session's first frame.
*/
class FusionHudHost(context: Context) {
private val context = context.applicationContext
private val handler = Handler(Looper.getMainLooper())
private val feed = GameFrameFeed(File(LinuxRuntime.rootDir(this.context), HudFrames.PATH))
private val readings = MangoReadings(File(this.context.filesDir, "session"), LinuxRuntime.rootDir(this.context))
private var view: FusionHudView? = null
private var parent: ViewGroup? = null
private var running = false
private var hidden = false
private var backgrounded = false
private var polling = false
private var wantX = Float.NaN
private var wantY = Float.NaN
private var engine = ""
private var gpuName = ""
private var protonPid = 0
private var proton = ""
@Volatile private var lastWindow: String? = null
var onPresentingWindowChanged: (() -> Unit)? = null
/** The HUD itself changed a setting: a tap cycles the size, a long press locks it. */
var onConfigChanged: (() -> Unit)? = null
private val listener = object : WaylandCompositor.GameListener {
override fun onGameSurface(window: String?, gpuName: String?) {
if (!gpuName.isNullOrBlank()) handler.post { this@FusionHudHost.gpuName = cleanGpuName(gpuName) }
if (window != null && window != lastWindow) {
lastWindow = window
handler.post { onPresentingWindowChanged?.invoke() }
}
}
override fun onGameFrame() {
feed.onCompositorFrame(System.nanoTime())
}
}
private val frameCallback = object : Choreographer.FrameCallback {
override fun doFrame(frameTimeNanos: Long) {
if (!running || !polling) return
if (feed.poll(System.nanoTime())) view?.onFrames()
Choreographer.getInstance().postFrameCallback(this)
}
}
private val enabled: Boolean
get() = SessionPrefs.hudEnabled(context) &&
!File(Environment.getExternalStorageDirectory(), "Download/droiddeck-no-hud").exists()
/** Adds the HUD to [root] at [index] (above the game surface, under the session overlay). */
fun attach(root: FrameLayout, index: Int) {
if (view != null) return
val hud = FusionHudView(root.context)
hud.setFrameStats(feed.stats)
hud.setMangoReadings(readings)
hud.setGpuModel(cleanGpuName(GpuInfo.detect().displayName(context)))
hud.onRefresh = Runnable { refreshLabels(hud) }
hud.setOnMovedListener { x, y ->
wantX = x; wantY = y
keepOnScreen(hud)
wantX = hud.x; wantY = hud.y
SessionPrefs.setFusionHudPosition(context, hud.x, hud.y)
}
hud.setOnSizeCycledListener { size -> FusionHudConfig.set(context, "hudSize", size); onConfigChanged?.invoke() }
hud.setOnLockChangedListener { locked ->
FusionHudConfig.set(context, "hudLocked", if (locked) "1" else "0")
onConfigChanged?.invoke()
}
hud.addOnLayoutChangeListener { _, _, _, _, _, _, _, _, _ -> if (!hud.isDragging) keepOnScreen(hud) }
hud.visibility = View.GONE
val margin = (16 * root.resources.displayMetrics.density).roundToInt()
root.addView(hud, index, FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT).apply {
leftMargin = margin
topMargin = margin
})
SessionPrefs.fusionHudPosition(context)?.let { (x, y) -> wantX = x; wantY = y; hud.post { keepOnScreen(hud) } }
view = hud
parent = root
applyConfig()
}
fun applyConfig() {
view?.applyConfig(FusionHudConfig.encode(FusionHudConfig.load(context)))
}
fun refresh() {
applyConfig()
if (!enabled) stop() else if (!running) start()
}
fun start() {
if (running || !enabled || view == null) return
running = true
WaylandCompositor.setGameListener(listener)
applyShown()
}
fun stop() {
running = false
showing = false
polling = false
Choreographer.getInstance().removeFrameCallback(frameCallback)
WaylandCompositor.clearGameListener(listener)
feed.close()
view?.visibility = View.GONE
}
/** Picture-in-picture and similar: keep running, draw nothing. */
fun setHidden(hide: Boolean) {
hidden = hide
applyShown()
}
/** The session screen is stopped (another app in front): draw nothing and stop reading sensors. */
fun setBackgrounded(stopped: Boolean) {
backgrounded = stopped
applyShown()
}
private fun applyShown() {
if (!running) return
val show = !hidden && !backgrounded
view?.visibility = if (show) View.VISIBLE else View.GONE
showing = show
// Frames are read once per display frame only while the HUD is drawn.
if (show != polling) {
polling = show
if (show) Choreographer.getInstance().postFrameCallback(frameCallback)
else Choreographer.getInstance().removeFrameCallback(frameCallback)
}
}
/** A sensor report (FusionHUD's diagnostics) in Downloads/DroidDeck; null when it can't be written. */
fun exportDiagnostics(): File? = runCatching {
val dir = File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), "DroidDeck")
dir.mkdirs()
val stamp = java.text.SimpleDateFormat("yyyyMMdd-HHmmss", java.util.Locale.US).format(java.util.Date())
val file = File(dir, "HUD-diagnostics-$stamp.txt")
// Its own reader: the HUD's CPU load is the change since its previous sample, which an export must
// not move. Two samples half a second apart, MangoHud's sampling period.
val metrics = HudMetrics(context)
metrics.setMangoReadings(MangoReadings(File(context.filesDir, "session"), LinuxRuntime.rootDir(context)))
metrics.snapshot()
Thread.sleep(500)
val mango = metrics.snapshot()
file.writeText(metrics.also { it.setMangoReadings(null) }.buildDiagnosticsReport(context) + "\n== As the HUD shows them (MangoHud's sources) ==\n" +
"CPU ${mango.cpuPercent}% ${mango.cpuTempC}°C, GPU ${mango.gpuPercent}% ${mango.gpuClockMhz}MHz ${mango.gpuTempC}°C, " +
"RAM ${mango.ramUsedText()}/${mango.ramTotalText()}, VRAM ${mango.vramText()}, battery ${mango.battery.percent}% " +
"${mango.battery.watts}W charging=${mango.battery.charging}\n" +
"CPU temperature zones: ${LinuxRuntime.cpuTempZones().joinToString { it.name }}\n" +
"Frames: ${if (feed.engine.isNotEmpty() || feed.pid > 0) "gamescope (pid ${feed.pid}, ${feed.engine})" else "compositor"}, " +
"fps ${feed.stats.fps}\n")
file
}.getOrNull()
private fun refreshLabels(hud: FusionHudView) {
if (feed.engine.isNotBlank() && !feed.steamFocused) engine = feed.engine
hud.setEngineLabel(engine)
if (gpuName.isNotBlank()) hud.setGpuModel(gpuName)
hud.setResolution(if (feed.outputWidth > 0 && feed.outputHeight > 0) buildString {
append(feed.outputWidth).append('x').append(feed.outputHeight)
if (feed.refreshMilliHz > 0) append(" @ ").append((feed.refreshMilliHz + 499) / 1000).append("Hz")
} else "")
val pid = feed.pid
if (pid > 0 && pid != protonPid) {
protonPid = pid
proton = protonName(pid) ?: proton
}
hud.setWineVersion(proton)
hud.setPresentedFps(presentedFps())
}
private fun presentedFps(): Float {
if (FrameGen.mode(context).engine == FrameGen.ENGINE_OFF) return 0f
val stats = runCatching { WaylandCompositor.nativeFrameGenStats() }.getOrNull() ?: return 0f
return if (stats.size > 3 && stats[3] > 1f) stats[3] else 0f
}
// The HUD is clamped from where the user left it (wantX/wantY, set on a drop or restore), not from where
// it is drawn: a window that shrinks and grows back (picture-in-picture, a fold) must not leave it in the
// corner the small window pushed it to.
private fun keepOnScreen(v: View) {
val p = v.parent as? View ?: return
if (p.width <= 0 || p.height <= 0 || v.width <= 0 || v.height <= 0) return
if (wantX.isNaN()) { wantX = v.x; wantY = v.y }
val maxX = (p.width - v.width).toFloat().coerceAtLeast(0f)
val maxY = (p.height - v.height).toFloat().coerceAtLeast(0f)
val x = wantX.coerceIn(0f, maxX)
val y = wantY.coerceIn(0f, maxY)
if (v.x != x) v.x = x
if (v.y != y) v.y = y
}
companion object {
/** True while the HUD is on screen; DroidDeck keeps sampling VRAM for it (GpuMemComponent). */
@Volatile @JvmStatic var showing = false
private set
/** "Adreno (TM) 750" as the driver names it, "Adreno 750" as DroidDeck does elsewhere. */
internal fun cleanGpuName(name: String): String = name.replace("(TM)", "").replace(Regex("\\s+"), " ").trim()
/** The Proton build of a game process: the first STEAM_COMPAT_TOOL_PATHS entry's folder. */
internal fun protonName(pid: Int): String? = runCatching {
val environ = File("/proc/$pid/environ").readBytes().toString(Charsets.UTF_8).split('\u0000')
val paths = environ.firstOrNull { it.startsWith("STEAM_COMPAT_TOOL_PATHS=") }?.substringAfter('=') ?: return null
paths.split(':').firstOrNull { it.isNotBlank() }?.trimEnd('/')?.substringAfterLast('/')
}.getOrNull()?.takeIf { it.isNotBlank() }
}
}
@@ -0,0 +1,86 @@
/*
* FusionHUD — a lightweight in-game performance HUD for Android / Winlator overlays.
* Copyright (C) The412Banner <https://github.com/The412Banner>
*
* Licensed under the GNU General Public License v3.0 (see LICENSE), with an
* ADDITIONAL attribution requirement under GPL-3.0 §7(b) (see ATTRIBUTION.md):
* any use, fork, or distribution must preserve credit to "The412Banner" and a
* link to https://github.com/The412Banner/FusionHUD in the project documentation
* AND in the in-app credits/about screen.
*
* Ported to DroidDeck from FusionHUD (Bannerlator's HUD); DroidDeck changes are marked in the code.
*/
package com.droiddeck.launcher.hud
/**
* Size modes for the Fusion HUD (the 4th selectable in-game overlay style). One shared color-coded
* visual language, four amounts of detail — see the approved mockup. The config value is the lower-case
* token stored under the `hudSize` key; the label is the user-facing string.
*/
enum class FusionSize(val token: String, val label: String) {
FULL("full", "Full"),
TILES("tiles", "Tiles"),
PILL("pill", "Pill"),
MINIMAL("minimal", "Minimal"),
MEGA("mega", "Mega");
/** Next size in the tap-cycle: Full → Tiles → Pill → Minimal → Mega → Full. */
fun next(): FusionSize {
val all = values()
return all[(ordinal + 1) % all.size]
}
/**
* The metric toggle chips this size actually renders — the SINGLE source of truth queried by BOTH
* config surfaces ({@code FpsCounterConfigDialog} + in-game {@code XServerDrawer} HudContent) so the
* chip list can't drift from what the view draws. Chip ids are the chip LABELS used in the UI.
* (Hiding a chip is purely UI; buildConfig() still emits every key — strip-invariant.)
*/
fun supportedChips(): Set<String> = when (this) {
MINIMAL -> MINIMAL_CHIPS
PILL -> PILL_CHIPS
FULL, TILES -> STANDARD_CHIPS
MEGA -> MEGA_CHIPS
}
companion object {
fun from(token: String?): FusionSize =
values().firstOrNull { it.token.equals(token, ignoreCase = true) } ?: FULL
// Chip-label ids (must match the labels the config UIs build). "Clock" is a small subtle
// corner readout available in EVERY size, so it's in all sets.
// The API/engine label ("Engine" chip) shows on the FPS row in EVERY size, so it's in all sets.
// "Wrapper" and "DX ver" are Mega-only: the wrapper appears solely below Mega's frametime graph,
// and "DX ver" gates the DX-version suffix on Mega's FPS-row engine label.
val MINIMAL_CHIPS = setOf("FPS", "FPS graph", "0.01% low", "FPS .1", "Engine", "Clock")
val PILL_CHIPS = setOf("FPS", "FPS graph", "GPU", "CPU", "VRAM", "RAM", "Battery", "GPU model", "FPS .1", "Engine", "Clock")
val STANDARD_CHIPS = setOf(
"FPS", "FPS graph", "GPU", "GPU temp", "CPU", "VRAM", "RAM", "Power", "Temp",
"Battery", "GPU model", "Engine", "0.01% low", "FPS .1", "Clock",
)
val MEGA_ONLY = setOf(
"Per-core", "Swap", "Network", "Resolution", "Proton", "Wrapper", "DX ver", "Session",
)
val MEGA_CHIPS = STANDARD_CHIPS + MEGA_ONLY
}
}
/**
* The Wayland HDR state the Fusion HUD shows on its own line, directly under the latency · display-server
* line (the host sets it with [FusionHudView.setHdrState]). [NONE] = no line at all: every session whose
* HDR gate is closed (X11, SDR screens, HDR off) keeps the HUD exactly as it was.
*/
object FusionHdr {
const val NONE = 0
const val ON = 1 // HDR frames on screen with HDR headroom
const val NO_HEADROOM = 2 // HDR frames on screen, but the display gives them no headroom (5 s+)
const val OFF = 3 // the drawer's HDR output switch is off (tone-mapped to SDR)
const val READY = 4 // HDR open for the session, no HDR frames on screen right now
const val TONEMAPPED = 5 // HDR output on, but the frames are shown tone-mapped (frame generation
// on a screen that offers no HDR10 swapchain)
const val NOT_ON_THIS_SCREEN = 6 // HDR open for the session, but the screen the game is on NOW
// reports no HDR10 (the TV was unplugged mid-game). The offer to the
// game cannot be withdrawn once made, so the gate stays open for the
// session — but "ready" would be a lie on a panel that cannot show it.
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,262 @@
package com.droiddeck.launcher.hud
import java.io.File
import kotlin.math.roundToInt
/**
* Frame statistics by MangoHud's rules, so the HUD and Steam's performance overlay agree: MangoHud
* overlay.cpp update_hud_info_with_frametime and hud_elements.cpp fps() / frame_timing(). The FPS is the
* frames counted over a sampling period of at least 500 ms, the frame time next to it is 1000 / FPS, and
* the graph holds the last 200 frame times (zeros until filled) on a fixed 0-50 ms scale, min and max
* taken over those 200. Average and lows are FusionHUD's own readouts.
*/
internal class FrameStats {
private val graph = FloatArray(GRAPH_FRAMES)
private var graphHead = 0
private var lastPresentNs = 0L
private var lastFpsUpdateNs = 0L
private var framesSinceUpdate = 0
private val lowsRing = LongArray(LOWS_FRAMES)
private var lowsHead = 0
private var lowsSize = 0
private var cachedLows = Lows.EMPTY
private var cachedLowsNs = 0L
private var sessionStartNs = 0L
private var sessionFrames = 0L
@Volatile var fps = 0f
private set
/** Completed sampling periods; MangoHud redraws its readouts when one completes. */
@Volatile var fpsUpdates = 0L
private set
/** Frames added so far; the HUD redraws its graph when this moves. */
@Volatile var count = 0L
private set
@Synchronized
fun add(frametimeNs: Long, timeNs: Long) {
if (frametimeNs <= 0L) return
if (lastPresentNs != 0L) {
graph[graphHead] = frametimeNs / 1e6f
graphHead = (graphHead + 1) % GRAPH_FRAMES
}
val elapsed = timeNs - lastFpsUpdateNs
if (elapsed >= FPS_PERIOD_NS) {
fps = (1e9 * framesSinceUpdate / elapsed).toFloat()
framesSinceUpdate = 0
lastFpsUpdateNs = timeNs
fpsUpdates++
}
lastPresentNs = timeNs
framesSinceUpdate++
if (frametimeNs < PAUSE_NS) {
lowsRing[lowsHead] = frametimeNs
lowsHead = (lowsHead + 1) % LOWS_FRAMES
if (lowsSize < LOWS_FRAMES) lowsSize++
if (sessionStartNs == 0L) sessionStartNs = timeNs - frametimeNs
sessionFrames++
}
count++
}
@Synchronized
fun reset() {
graph.fill(0f)
graphHead = 0
lastPresentNs = 0L
lastFpsUpdateNs = 0L
framesSinceUpdate = 0
lowsHead = 0
lowsSize = 0
cachedLows = Lows.EMPTY
cachedLowsNs = 0L
sessionStartNs = 0L
sessionFrames = 0L
fps = 0f
count++
}
/** MangoHud's frame time readout: 1000 / FPS. */
fun frametimeMs(): Float = 1000f / maxOf(fps, 1f)
/** The graph, oldest first, into [out] (GRAPH_FRAMES long). */
@Synchronized
fun graph(out: FloatArray) {
for (i in 0 until GRAPH_FRAMES) out[i] = graph[(graphHead + i) % GRAPH_FRAMES]
}
@Synchronized
fun graphMinMs(): Float = graph.min()
@Synchronized
fun graphMaxMs(): Float = graph.max()
/** Average over the frames this session, from the first frame to [nowNs]'s last frame. */
@Synchronized
fun averageFps(): Float {
if (sessionFrames < 2 || lastPresentNs <= sessionStartNs) return 0f
return (1e9 * sessionFrames / (lastPresentNs - sessionStartNs)).toFloat()
}
@Synchronized
fun sessionSeconds(nowNs: Long): Float = if (sessionStartNs == 0L) 0f else (nowNs - sessionStartNs) / 1e9f
class Lows(val low1Fps: Float, val low01Fps: Float, val low001Fps: Float) {
companion object {
val EMPTY = Lows(0f, 0f, 0f)
}
}
/** FPS at the 99th, 99.9th and 99.99th percentile frame time of the last LOWS_FRAMES frames. */
fun lows(nowNs: Long): Lows {
val copy: LongArray
synchronized(this) {
if (cachedLows !== Lows.EMPTY && nowNs - cachedLowsNs < LOWS_RECOMPUTE_NS) return cachedLows
if (lowsSize < 2) return Lows.EMPTY
copy = LongArray(lowsSize)
val start = (lowsHead - lowsSize + LOWS_FRAMES) % LOWS_FRAMES
for (i in 0 until lowsSize) copy[i] = lowsRing[(start + i) % LOWS_FRAMES]
}
copy.sort()
fun at(p: Double): Float {
val ft = copy[(p * (copy.size - 1)).roundToInt().coerceIn(0, copy.size - 1)]
return if (ft > 0) (1e9 / ft).toFloat() else 0f
}
val result = Lows(at(0.99), at(0.999), at(0.9999))
synchronized(this) {
cachedLows = result
cachedLowsNs = nowNs
}
return result
}
companion object {
const val GRAPH_FRAMES = 200
const val GRAPH_MAX_MS = 50f
const val FPS_PERIOD_NS = 500_000_000L
const val LOWS_FRAMES = 8192
private const val PAUSE_NS = 1_000_000_000L
private const val LOWS_RECOMPUTE_NS = 250_000_000L
}
}
/**
* Feeds [stats] with the frame times gamescope shares (the ones MangoHud shows). Sessions without the
* shared file, or where gamescope stopped sending, fall back to the frames DroidDeck's compositor shows,
* which stop at the screen's refresh rate.
*/
internal class GameFrameFeed(private val file: File, val stats: FrameStats = FrameStats()) {
private var handle = 0L
private var nextOpenNs = 0L
private var lastRingFrameNs = 0L
private var lastInfoNs = 0L
private val frametimes = LongArray(HudFrames.CAPACITY)
private val times = LongArray(HudFrames.CAPACITY)
private val info = IntArray(5)
@Volatile private var fromGamescope = false
private var lastCompositorNs = 0L
@Volatile private var compositorFrames = 0L // written by the compositor thread only
private var seenCompositorFrames = 0L
@Volatile var engine = ""
private set
@Volatile var steamFocused = false
private set
@Volatile var pid = 0
private set
@Volatile var outputWidth = 0
private set
@Volatile var outputHeight = 0
private set
@Volatile var refreshMilliHz = 0
private set
/** Main thread, once per display frame. True when new frames arrived. */
fun poll(nowNs: Long): Boolean {
val compositorAdded = compositorFrames != seenCompositorFrames
seenCompositorFrames = compositorFrames
if (handle == 0L) {
if (nowNs < nextOpenNs) return compositorAdded
nextOpenNs = nowNs + REOPEN_NS
handle = runCatching { HudFrames.nativeOpen(file.path) }.getOrDefault(0L)
if (handle == 0L) return compositorAdded
// Frames already in the file were written before this reader started.
HudFrames.nativePoll(handle, frametimes, times)
}
val n = HudFrames.nativePoll(handle, frametimes, times)
if (n > 0) {
if (!fromGamescope) {
stats.reset()
fromGamescope = true
}
for (i in 0 until n) stats.add(frametimes[i], times[i])
lastRingFrameNs = times[n - 1]
} else if (lastRingFrameNs != 0L && nowNs - lastRingFrameNs > LIVE_NS) {
fromGamescope = false
}
// A new session writes the file again from the start; reopen when gamescope has gone quiet.
if (n <= 0 && nowNs - maxOf(lastRingFrameNs, nextOpenNs - REOPEN_NS) > STALE_NS) close()
if (nowNs - lastInfoNs >= INFO_NS) {
lastInfoNs = nowNs
readInfo()
}
return n > 0 || compositorAdded
}
/** Compositor thread: one frame shown on the panel. */
fun onCompositorFrame(nowNs: Long) {
if (fromGamescope) {
lastCompositorNs = 0L
return
}
val last = lastCompositorNs
lastCompositorNs = nowNs
if (last != 0L) {
stats.add(nowNs - last, nowNs)
compositorFrames++
}
}
fun close() {
if (handle != 0L) HudFrames.nativeClose(handle)
handle = 0L
}
private fun readInfo() {
val name = if (handle != 0L && fromGamescope) HudFrames.nativeInfo(handle, info) else null
if (name == null) {
engine = ""
return
}
pid = info[0]
outputWidth = info[1]
outputHeight = info[2]
refreshMilliHz = info[3]
steamFocused = info[4] != 0
engine = engineLabel(name)
}
companion object {
private const val REOPEN_NS = 2_000_000_000L
private const val LIVE_NS = 2_000_000_000L
private const val STALE_NS = 5_000_000_000L
private const val INFO_NS = 500_000_000L
/** DroidDeck's mangoapp's names for gamescope's engine field (Valve's 20260902.1 build, app/main.cpp
* engine_type_from_str and overlay.h engines); gamescope sends "gamescope" when it knows none. */
fun engineLabel(name: String): String = when (name) {
"DXVK" -> "DXVK"
"vkd3d" -> "VKD3D"
"mesa zink" -> "ZINK"
"Damavand" -> "DAMAVAND"
"Feral3D" -> "Feral3D"
"gamescope", "" -> "GAMESCOPE"
else -> "VULKAN"
}
}
}
@@ -0,0 +1,17 @@
package com.droiddeck.launcher.hud
/** Reader for the frame-times file gamescope patch 0125 writes (hudframes.c). */
internal object HudFrames {
init {
System.loadLibrary("droiddeckwayland")
}
/** Under the Linux root: the session exports /run/droiddeck-hud/frames to gamescope. */
const val PATH = "run/droiddeck-hud/frames"
const val CAPACITY = 1024
@JvmStatic external fun nativeOpen(path: String): Long
@JvmStatic external fun nativeClose(handle: Long)
@JvmStatic external fun nativePoll(handle: Long, frametimes: LongArray, times: LongArray): Int
@JvmStatic external fun nativeInfo(handle: Long, info: IntArray): String?
}
@@ -0,0 +1,265 @@
/*
* FusionHUD — a lightweight in-game performance HUD for Android / Winlator overlays.
* Copyright (C) The412Banner <https://github.com/The412Banner>
*
* Licensed under the GNU General Public License v3.0 (see LICENSE), with an
* ADDITIONAL attribution requirement under GPL-3.0 §7(b) (see ATTRIBUTION.md):
* any use, fork, or distribution must preserve credit to "The412Banner" and a
* link to https://github.com/The412Banner/FusionHUD in the project documentation
* AND in the in-app credits/about screen.
*
* Ported to DroidDeck from FusionHUD (Bannerlator's HUD); DroidDeck changes are marked in the code.
*/
package com.droiddeck.launcher.hud;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.RectF;
import android.os.SystemClock;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
/**
* Shared touch + lock behaviour for every in-game performance HUD (classic FrameRating(+Horizontal),
* GameHub PerfHudView, GameNative PerformanceHudView, and the Fusion HUD). One place so the four
* overlays can't drift:
*
* <ul>
* <li><b>tap</b> → {@link Callbacks#onTap()} (orientation-toggle for the first three; size-cycle for
* Fusion) — a no-op that only re-flashes the lock badge while locked.</li>
* <li><b>drag</b> → moves the host view and, on release, {@link Callbacks#onMoved} to persist the
* position — disabled (frozen) while locked.</li>
* <li><b>long-press</b> → toggles {@code hudLocked}, persisted via {@link Callbacks#onLockChanged}
* and kept in sync with the "Lock in place" menu chip. Works locked or unlocked (so a long-press
* always unlocks).</li>
* </ul>
*
* <p>On every lock/unlock (and on a blocked gesture while locked) a small padlock badge fades in →
* holds → fades out in a corner of the panel. The fade is driven by a self-reposting Runnable that
* invalidates only while visible — nothing runs on the present path, nothing animates at rest.
*
* <p>All methods are Main-thread only (touch + draw), matching the epoll-thread rule: the views feed
* this from {@code onTouchEvent}/{@code dispatchDraw}, never from a present tick.
*/
public class HudLockController {
public interface Callbacks {
/** Unlocked single tap: orientation-toggle (classic/gamehub/gamenative) or size-cycle (fusion). */
void onTap();
/** Drag released (unlocked): persist the new (x, y). */
void onMoved(float x, float y);
/** Lock toggled by long-press: persist {@code hudLocked} + sync the menu chip. */
void onLockChanged(boolean locked);
}
// Fade timing (ms): in → hold → out. Lock/unlock hold ~1.5 s; a blocked-gesture re-flash is shorter.
private static final long FADE_IN_MS = 160;
private static final long HOLD_TOGGLE_MS = 1500;
private static final long HOLD_REFLASH_MS = 750;
private static final long FADE_OUT_MS = 420;
private static final long FRAME_MS = 32;
private final View view;
private final Callbacks cb;
private final GestureDetector detector;
private boolean locked = false;
// Drag state
private float downRawX, downRawY, startX, startY;
private boolean dragging = false;
// Fade state
private long fadeStart = 0;
private long holdMs = HOLD_TOGGLE_MS;
private boolean fadeShowLocked = false;
private final Paint iconFill = new Paint(Paint.ANTI_ALIAS_FLAG);
private final Paint iconStroke = new Paint(Paint.ANTI_ALIAS_FLAG);
public HudLockController(Context context, View view, Callbacks cb) {
this.view = view;
this.cb = cb;
this.detector = new GestureDetector(context, new Listener());
this.detector.setIsLongpressEnabled(true);
iconFill.setStyle(Paint.Style.FILL);
iconStroke.setStyle(Paint.Style.STROKE);
iconStroke.setStrokeCap(Paint.Cap.ROUND);
iconStroke.setStrokeJoin(Paint.Join.ROUND);
}
/** Set lock state from config (applyConfig) WITHOUT firing the persist callback. */
public void setLocked(boolean locked) { this.locked = locked; }
public boolean isLocked() { return locked; }
public boolean isDragging() { return dragging; }
/** Feed from the host view's onTouchEvent. Always consumes (mirrors the legacy manual handlers). */
public boolean onTouchEvent(MotionEvent event) {
detector.onTouchEvent(event);
int action = event.getActionMasked();
if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) {
if (dragging && !locked) cb.onMoved(view.getX(), view.getY());
dragging = false;
}
return true;
}
private final class Listener extends GestureDetector.SimpleOnGestureListener {
@Override
public boolean onDown(MotionEvent e) {
downRawX = e.getRawX();
downRawY = e.getRawY();
startX = view.getX();
startY = view.getY();
dragging = false;
return true;
}
@Override
public void onLongPress(MotionEvent e) {
// Long-press always toggles — this is the only gesture that still works while locked.
locked = !locked;
cb.onLockChanged(locked);
flash(locked, HOLD_TOGGLE_MS);
}
@Override
public boolean onSingleTapUp(MotionEvent e) {
if (locked) {
flash(true, HOLD_REFLASH_MS); // intentionally locked — remind the user
} else {
cb.onTap();
}
return true;
}
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
if (locked) {
if (!dragging) flash(true, HOLD_REFLASH_MS);
dragging = true; // mark so the blocked drag doesn't fall through to a tap
return true;
}
view.setX(startX + (e2.getRawX() - downRawX));
view.setY(startY + (e2.getRawY() - downRawY));
dragging = true;
return true;
}
}
// ---- Fade badge -------------------------------------------------------
private void flash(boolean showLocked, long hold) {
fadeShowLocked = showLocked;
holdMs = hold;
fadeStart = SystemClock.elapsedRealtime();
view.removeCallbacks(fadeTick);
view.post(fadeTick);
}
private final Runnable fadeTick = new Runnable() {
@Override
public void run() {
view.invalidate();
if (currentAlpha() > 0f) view.postDelayed(this, FRAME_MS);
}
};
private float currentAlpha() {
if (fadeStart == 0) return 0f;
long e = SystemClock.elapsedRealtime() - fadeStart;
if (e < 0) return 0f;
if (e < FADE_IN_MS) return e / (float) FADE_IN_MS;
long holdEnd = FADE_IN_MS + holdMs;
if (e < holdEnd) return 1f;
long outEnd = holdEnd + FADE_OUT_MS;
if (e < outEnd) return 1f - (e - holdEnd) / (float) FADE_OUT_MS;
return 0f;
}
private static int withAlpha(int color, float a) {
return Color.argb(Math.round(255 * a), Color.red(color), Color.green(color), Color.blue(color));
}
/**
* Draw the padlock badge in the top-right of the panel if a fade is in progress. Call from the
* host's onDraw (plain View) or dispatchDraw (ViewGroup), after the content.
*
* <p>No background box: the glyph is drawn twice — a slightly expanded, thicker semi-transparent
* black "halo" pass for legibility on any game frame, then the white glyph on top — so it reads as
* a floating icon, not an opaque tile.
*/
public void drawBadge(Canvas canvas) {
float a = currentAlpha();
if (a <= 0f) return;
float d = view.getResources().getDisplayMetrics().density;
float size = 15f * d;
float margin = 4f * d;
float right = view.getWidth() - margin;
float left = right - size;
float top = margin;
float cx = (left + right) / 2f;
float bottom = top + size;
float bodyTop = top + size * 0.46f;
float bodyLeft = left + size * 0.14f;
float bodyRight = right - size * 0.14f;
float r = size * 0.2f;
float shackleTop = top + size * 0.08f;
// Pass 1: dark halo (expanded body, thicker shackle) for contrast; Pass 2: white glyph.
drawLock(canvas, cx, bodyTop, bodyLeft, bodyRight, bottom, r, shackleTop, d,
Color.argb(Math.round(150 * a), 0, 0, 0), 3.0f * d, 0.9f * d, false);
drawLock(canvas, cx, bodyTop, bodyLeft, bodyRight, bottom, r, shackleTop, d,
withAlpha(0xFFFFFFFF, a), 1.7f * d, 0f, true);
}
/** One padlock pass. {@code halo} inflates the body/shackle in dark; the white pass punches the keyhole. */
private void drawLock(Canvas canvas, float cx, float bodyTop, float bodyLeft, float bodyRight,
float bottom, float r, float shackleTop, float d,
int color, float strokeW, float expand, boolean punchKeyhole) {
iconFill.setColor(color);
iconStroke.setColor(color);
iconStroke.setStrokeWidth(strokeW);
// Body
canvas.drawRoundRect(bodyLeft - expand, bodyTop - expand, bodyRight + expand, bottom + expand,
2.4f * d, 2.4f * d, iconFill);
if (punchKeyhole) {
int prev = iconFill.getColor();
iconFill.setColor(Color.argb(Color.alpha(color), 0, 0, 0));
canvas.drawCircle(cx, (bodyTop + bottom) / 2f, 1.6f * d, iconFill);
iconFill.setColor(prev);
}
RectF arc = new RectF(cx - r, shackleTop, cx + r, shackleTop + 2f * r);
if (fadeShowLocked) {
// Closed: both legs run straight down into the body.
Path p = new Path();
p.addArc(arc, 180f, 180f);
p.moveTo(cx - r, shackleTop + r); p.lineTo(cx - r, bodyTop);
p.moveTo(cx + r, shackleTop + r); p.lineTo(cx + r, bodyTop);
canvas.drawPath(p, iconStroke);
} else {
// Open, clearly to the LEFT: the RIGHT leg stays seated in the body; the arc + LEFT leg
// hinge up-and-left off the right attachment so the left leg lifts well clear of the body.
canvas.drawLine(cx + r, shackleTop + r, cx + r, bodyTop, iconStroke); // fixed right leg
Path p = new Path();
p.addArc(arc, 180f, 180f);
p.moveTo(cx - r, shackleTop + r); p.lineTo(cx - r, bodyTop); // full-length left leg
canvas.save();
canvas.rotate(-42f, cx + r, shackleTop + r);
canvas.drawPath(p, iconStroke);
canvas.restore();
}
}
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,132 @@
/*
* FusionHUD — a lightweight in-game performance HUD for Android / Winlator overlays.
* Copyright (C) The412Banner <https://github.com/The412Banner>
*
* Licensed under the GNU General Public License v3.0 (see LICENSE), with an
* ADDITIONAL attribution requirement under GPL-3.0 §7(b) (see ATTRIBUTION.md):
* any use, fork, or distribution must preserve credit to "The412Banner" and a
* link to https://github.com/The412Banner/FusionHUD in the project documentation
* AND in the in-app credits/about screen.
*
* Ported to DroidDeck from FusionHUD (Bannerlator's HUD); DroidDeck changes are marked in the code.
*/
package com.droiddeck.launcher.hud;
import androidx.annotation.NonNull;
import java.util.Iterator;
public class KeyValueSet implements Iterable<String[]> {
private String data = "";
// Default constructor for an empty KeyValueSet
public KeyValueSet() {
this.data = "";
}
// Constructor to initialize with a string representation of key-value pairs
public KeyValueSet(String data) {
this.data = data != null && !data.isEmpty() ? data : "";
}
// Helper method to find the start and end indices of a key in the data string
private int[] indexOfKey(String key) {
int start = 0;
int end = data.indexOf(",");
if (end == -1) end = data.length();
while (start < end) {
int index = data.indexOf("=", start);
String currKey = data.substring(start, index);
if (currKey.equals(key)) return new int[]{start, end};
start = end + 1;
end = data.indexOf(",", start);
if (end == -1) end = data.length();
}
return null;
}
// Method to get the value associated with a key, or an empty string if the key is not present
public String get(String key) {
for (String[] keyValue : this) if (keyValue[0].equals(key)) return keyValue[1];
return "";
}
// Method to get the value associated with a key, or a fallback value if the key is not present
public String get(String key, String fallback) {
for (String[] keyValue : this) if (keyValue[0].equals(key)) return keyValue[1];
return fallback;
}
// Method to get a boolean value associated with a key, or a fallback value if the key is not present
public boolean getBoolean(String key, boolean fallback) {
String value = get(key);
if (value.isEmpty()) return fallback;
return value.equals("1") || value.equals("t") || value.equalsIgnoreCase("true");
}
// Method to get a float value associated with a key, or a fallback value if the key is not present
public float getFloat(String key, float fallback) {
String value = get(key);
try {
if (!value.isEmpty()) return Float.parseFloat(value);
} catch (NumberFormatException e) {
// Ignore exception and return fallback
}
return fallback;
}
// Method to set a value for a key in the key-value data
public void put(String key, Object value) {
int[] range = indexOfKey(key);
if (range != null) {
data = data.substring(0, range[0]) + key + "=" + value + data.substring(range[1]);
} else {
data = (!data.isEmpty() ? data + "," : "") + key + "=" + value;
}
}
// Method to set a float value for a key in the key-value data
public void put(String key, float value) {
put(key, String.valueOf(value));
}
// Iterator implementation for key-value pairs in the format [key, value]
@NonNull
@Override
public Iterator<String[]> iterator() {
final int[] start = {0};
final int[] end = {data.indexOf(",")};
// A single-item config (no comma) gives indexOf == -1, making hasNext() (start < end)
// immediately false so the sole pair was never iterated (get() then returned the
// fallback). Guard it exactly as next() already does. An empty string still yields
// end == 0 → no iteration, which is correct.
if (end[0] == -1) end[0] = data.length();
final String[] item = new String[2];
return new Iterator<String[]>() {
@Override
public boolean hasNext() {
return start[0] < end[0];
}
@Override
public String[] next() {
int index = data.indexOf("=", start[0]);
item[0] = data.substring(start[0], index);
item[1] = data.substring(index + 1, end[0]);
start[0] = end[0] + 1;
end[0] = data.indexOf(",", start[0]);
if (end[0] == -1) end[0] = data.length();
return item;
}
};
}
@NonNull
@Override
public String toString() {
return data;
}
}
@@ -0,0 +1,157 @@
package com.droiddeck.launcher.hud
import com.droiddeck.launcher.runtime.LinuxRuntime
import java.io.File
/**
* The readings Steam's performance overlay shows in a DroidDeck session (Valve's mangohud 20260902.1,
* tools/mangoapp), taken from the files the session hands it and computed the same way, so the two
* overlays agree. Sources and formulas follow that build: cpu.cpp calculateCPUData, deckard_temp.cpp,
* msm.cpp getQcomGpuInfo, memory.cpp update_meminfo and battery.cpp getPercent / getPower.
*/
internal class MangoReadings(private val sessionDir: File, private val rootDir: File) {
class Cpu(val percent: Int, val perCore: IntArray)
class Memory(val usedBytes: Long, val totalBytes: Long, val swapUsedBytes: Long, val swapTotalBytes: Long)
class Battery(val percent: Int?, val watts: Float, val charging: Boolean)
private val cpuTimes = HashMap<String, LongArray>()
private val cpuPercents = HashMap<String, Int>()
/** Total and per-core load from the session's /proc/stat (DroidDeck's stand-in when the app can't read it). */
@JvmOverloads
fun cpu(stat: File = statFile()): Cpu? {
val lines = runCatching { stat.readLines() }.getOrNull() ?: return null
var total: Int? = null
val cores = ArrayList<Int>()
for (line in lines) {
if (!line.startsWith("cpu")) break
val parts = line.split(WHITESPACE)
if (parts.size < 11) continue
val values = LongArray(10) { parts[it + 1].toLongOrNull() ?: 0L }
val percent = cpuPercent(parts[0], values)
if (parts[0] == "cpu") total = percent else cores.add(percent)
}
return total?.let { Cpu(it, cores.toIntArray()) }
}
private fun statFile(): File =
File(sessionDir, "proc-stat").takeIf { !File("/proc/stat").canRead() && it.isFile } ?: File("/proc/stat")
private fun cpuPercent(key: String, v: LongArray): Int {
// user nice system idle iowait irq softirq steal guest guest_nice; guest time is already in user.
val user = v[0] - v[8]
val nice = v[1] - v[9]
val systemAll = v[2] + v[5] + v[6]
val idleAll = v[3] + v[4]
val virt = v[8] + v[9]
val totalTime = user + nice + systemAll + idleAll + v[7] + virt
val now = longArrayOf(user, nice, systemAll, v[7], virt, totalTime)
val last = cpuTimes.put(key, now) ?: LongArray(6)
fun period(i: Int) = if (now[i] > last[i]) now[i] - last[i] else 0L
val totalPeriod = period(5).toFloat()
if (totalPeriod == 0f) return cpuPercents[key] ?: 0
val busy = period(1) * 100f / totalPeriod + period(0) * 100f / totalPeriod +
period(2) * 100f / totalPeriod + (period(3) + period(4)) * 100f / totalPeriod
return busy.coerceIn(0f, 100f).toInt().also { cpuPercents[key] = it }
}
/** Average of the zones the session types cpuN-thermal, truncated. */
fun cpuTempC(): Int? {
var sum = 0f
var count = 0
for (zone in LinuxRuntime.cpuTempZones()) {
val milli = readLong(File(zone, "temp")) ?: continue
sum += milli / 1000f
count++
}
return if (count == 0) null else (sum / count).toInt()
}
fun gpuPercent(): Int? {
val feed = fresh(File(sessionDir, "sys/kgsl-3d0/perf_now"))
val source = feed ?: LinuxRuntime.gpuLoadSource()?.let(::File) ?: return null
return leadingNumber(source)?.toInt()?.coerceIn(0, 100)
}
fun gpuClockMhz(): Int? {
val feed = fresh(File(sessionDir, "sys/kgsl-3d0/cur_freq"))
val source = feed ?: listOf("$KGSL/devfreq/cur_freq", "$KGSL/gpuclk").map(::File).firstOrNull { it.canRead() } ?: return null
val hz = leadingNumber(source) ?: return null
return (hz / 1_000_000.0).toInt().takeIf { it > 0 }
}
fun gpuTempC(): Int? {
val milli = LinuxRuntime.gpuTempSource()?.let { readLong(File(it)) } ?: return null
return (milli / 1000.0).toInt()
}
/** MemTotal - MemAvailable and SwapTotal - SwapFree from /proc/meminfo. */
fun memory(): Memory? {
val kb = HashMap<String, Long>()
runCatching {
File("/proc/meminfo").forEachLine { line ->
val colon = line.indexOf(':')
if (colon > 0) line.substring(colon + 1).trim().split(WHITESPACE).firstOrNull()?.toLongOrNull()
?.let { kb[line.substring(0, colon)] = it }
}
}
val total = kb["MemTotal"] ?: return null
val available = kb["MemAvailable"] ?: return null
val swapTotal = kb["SwapTotal"] ?: 0L
val swapFree = kb["SwapFree"] ?: 0L
return Memory((total - available) * 1024, total * 1024, (swapTotal - swapFree) * 1024, swapTotal * 1024)
}
/** The KGSL total DroidDeck shares with the session (GpuMemComponent). */
fun vramBytes(): Long? = fresh(File(rootDir, VRAM_FILE), VRAM_FRESH_MS)?.let(::readLong)
/** BAT* under the session's power_supply (BatteryComponent): no watts while charging, full or unknown. */
fun battery(): Battery? {
val dirs = File(sessionDir, "sys/power_supply").listFiles { f -> f.name.contains("BAT") }?.sortedBy { it.name }
if (dirs.isNullOrEmpty()) return null
var chargeNow = 0f
var chargeFull = 0f
var watts = 0f
var charging = false
for (dir in dirs) {
val status = runCatching { File(dir, "status").readLines().firstOrNull() }.getOrNull()
if (status == "Charging" || status == "Unknown" || status == "Full") charging = true
val now = File(dir, "charge_now").takeIf { it.exists() } ?: File(dir, "energy_now")
val full = File(dir, "charge_full").takeIf { it.exists() } ?: File(dir, "energy_full")
if (now.exists()) {
chargeNow += (readFloat(now) ?: 0f) / 1_000_000f
chargeFull += (readFloat(full) ?: 0f) / 1_000_000f
} else {
chargeNow += (readFloat(File(dir, "capacity")) ?: 0f) / 100f
chargeFull = dirs.size.toFloat()
}
if (!charging) {
val power = File(dir, "power_now")
watts += if (power.exists()) kotlin.math.abs(readFloat(power) ?: 0f) / 1_000_000f
else kotlin.math.abs((readFloat(File(dir, "current_now")) ?: 0f) * (readFloat(File(dir, "voltage_now")) ?: 0f)) / 1e12f
}
}
val percent = if (chargeFull > 0f) Math.round(chargeNow / chargeFull * 100f) else null
return Battery(percent, if (charging) 0f else watts, charging)
}
private fun fresh(file: File, maxAgeMs: Long = FEED_FRESH_MS): File? =
file.takeIf { it.isFile && System.currentTimeMillis() - it.lastModified() < maxAgeMs }
companion object {
private const val KGSL = "/sys/class/kgsl/kgsl-3d0"
const val VRAM_FILE = "run/droiddeck-hud/gpu-mem"
private const val FEED_FRESH_MS = 10_000L
private const val VRAM_FRESH_MS = 15_000L
private val WHITESPACE = Regex("\\s+")
private fun readLong(file: File): Long? = runCatching { file.readText().trim().toLong() }.getOrNull()
private fun readFloat(file: File): Float? = runCatching { file.readLines().first().trim().toFloat() }.getOrNull()
/** std::stod on the first line: the leading number, "6 %" -> 6. */
fun leadingNumber(file: File): Double? = runCatching {
Regex("^\\s*-?\\d+(\\.\\d+)?").find(file.readLines().first())?.value?.trim()?.toDouble()
}.getOrNull()
}
}
@@ -341,9 +341,9 @@ public final class LinuxRuntime {
}
public static String cpuTempSource() {
for (java.util.Map.Entry<String, File> e : new java.util.TreeMap<>(thermalZones()).entrySet()) {
File temp = new File(e.getValue(), "temp");
if (e.getKey().contains("cpu") && !e.getKey().contains("gpu") && temp.canRead()) return temp.getPath();
for (File zone : cpuTempZones()) {
File temp = new File(zone, "temp");
if (temp.canRead()) return temp.getPath();
}
return null;
}
@@ -353,7 +353,7 @@ public final class LinuxRuntime {
return firstReadable(kgsl + "temp", kgsl + "devfreq/temp", thermalZone("gpu"));
}
private static String gpuLoadSource() {
public static String gpuLoadSource() {
String kgsl = "/sys/class/kgsl/kgsl-3d0/";
return firstReadable(kgsl + "gpu_busy_percentage", kgsl + "devfreq/gpu_load");
}
@@ -367,7 +367,7 @@ public final class LinuxRuntime {
"/sys/devices/platform/soc@0/3d00000.gpu/devfreq/3d00000.gpu/cur_freq"},
{gpuTemp, "/sys/class/thermal/thermal_zone28/temp"},
{gpuTemp, "/sys/class/thermal/thermal_zone26/temp"},
{thermalZone("ddr"), "/sys/class/thermal/thermal_zone22/temp"},
{ddrTempSource(), "/sys/class/thermal/thermal_zone22/temp"},
};
for (String[] stat : stats) {
boolean fed = false;
@@ -384,6 +384,36 @@ public final class LinuxRuntime {
return path != null ? path : "none";
}
private static String ddrTempSource() {
return thermalZone("ddr");
}
// MangoHud reads the GPU and DDR temperatures from these zone numbers (bindAdrenoStats). On phones
// where they are CPU zones, their type follows the temperature put there, so they stay out of the
// CPU average.
private static java.util.Map<String, String> replacedZoneTypes() {
java.util.Map<String, String> replaced = new java.util.HashMap<>();
if (gpuTempSource() != null) {
replaced.put("thermal_zone28", "gpu-thermal");
replaced.put("thermal_zone26", "gpu-thermal");
}
if (ddrTempSource() != null) replaced.put("thermal_zone22", "ddr-thermal");
return replaced;
}
/** The zones the session's MangoHud averages for the CPU temperature (all typed cpuN-thermal there). */
public static List<File> cpuTempZones() {
java.util.Map<String, String> replaced = replacedZoneTypes();
List<File> zones = new ArrayList<>();
for (java.util.Map.Entry<String, File> zone : new java.util.TreeMap<>(thermalZones()).entrySet()) {
String type = zone.getKey();
if (type.contains("cpu") && !type.contains("gpu") && !replaced.containsKey(zone.getValue().getName())) {
zones.add(zone.getValue());
}
}
return zones;
}
private static void bindCpuTemps(List<String> cmd, File root) {
File name = new File(root, "etc/droiddeck/cpu-thermal-type");
try {
@@ -391,9 +421,18 @@ public final class LinuxRuntime {
} catch (IOException e) {
return;
}
java.util.Map<String, String> replaced = replacedZoneTypes();
for (java.util.Map.Entry<String, File> zone : thermalZones().entrySet()) {
String type = zone.getKey();
if (type.contains("cpu") && !type.contains("gpu") && !type.matches("cpu\\d-(top-)?thermal")) {
String other = replaced.get(zone.getValue().getName());
if (other != null) {
File typeFile = new File(root, "etc/droiddeck/" + other + "-type");
try {
if (!typeFile.isFile()) Files.write(typeFile.toPath(), (other + "\n").getBytes(StandardCharsets.US_ASCII));
bind(cmd, typeFile.getPath() + ":" + new File(zone.getValue(), "type").getPath());
} catch (IOException ignored) {
}
} else if (type.contains("cpu") && !type.contains("gpu") && !type.matches("cpu\\d-(top-)?thermal")) {
bind(cmd, name.getPath() + ":" + new File(zone.getValue(), "type").getPath());
}
}
@@ -21,7 +21,7 @@ class GpuMemComponent(private val file: File, private val root: File) : SessionP
thread = Thread({
while (running) {
try { Thread.sleep(PERIOD_MS) } catch (e: InterruptedException) { break }
if (running && OverlayShown.check(root)) sample()?.let { write(it) }
if (running && (OverlayShown.check(root) || com.droiddeck.launcher.hud.FusionHudHost.showing)) sample()?.let { write(it) }
}
}, "gpu-mem").apply { isDaemon = true; start() }
}
@@ -1,178 +0,0 @@
package com.droiddeck.launcher.session
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.os.BatteryManager
import android.os.Environment
import android.os.Handler
import android.os.Looper
import android.os.SystemClock
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import com.droiddeck.launcher.R
import com.droiddeck.launcher.gpu.FrameGen
import com.droiddeck.launcher.gpu.Lossless
import com.droiddeck.launcher.wayland.WaylandCompositor
import java.io.File
import java.util.Locale
import java.util.concurrent.atomic.AtomicInteger
class PerfHud(context: Context) {
var text by mutableStateOf("")
private set
var graph by mutableStateOf(FloatArray(0))
private set
private val context = context.applicationContext
private val frames = AtomicInteger()
private var lastTick = 0L
private var lastFps = 0f
private var running = false
private val handler = Handler(Looper.getMainLooper())
private val samples = FloatArray(GRAPH)
private var graphBase = 0L
private var graphSeen = 0L
@Volatile private var showFps = true
@Volatile private var showBattery = true
@Volatile private var showGraph = true
private val enabled: Boolean
get() = SessionPrefs.hudEnabled(context)
&& !File(Environment.getExternalStorageDirectory(), "Download/droiddeck-no-hud").exists()
private val anyPart: Boolean
get() = showFps || showBattery || showGraph
var onPresentingWindowChanged: (() -> Unit)? = null
private var lastWindow: String? = null
private val listener = object : WaylandCompositor.GameListener {
override fun onGameSurface(window: String?, gpuName: String?) {
if (window != null && window != lastWindow) {
lastWindow = window
handler.post { onPresentingWindowChanged?.invoke() }
}
}
override fun onGameFrame() {
frames.incrementAndGet()
}
}
private val tick = object : Runnable {
override fun run() {
if (!running) return
val now = SystemClock.elapsedRealtime()
val dt = (now - lastTick).coerceAtLeast(1L) / 1000f
lastTick = now
lastFps = frames.getAndSet(0) / dt
text = readout(lastFps)
if (showGraph) publishGraph() else clearGraph()
handler.postDelayed(this, TICK_MS)
}
}
fun refresh() {
readOptions()
if (!enabled || !anyPart) {
stop()
return
}
if (!running) start() else {
if (!showGraph) clearGraph() else publishGraph()
text = readout(lastFps)
}
}
fun start() {
readOptions()
if (!enabled || !anyPart || running) return
running = true
lastTick = SystemClock.elapsedRealtime()
frames.set(0)
graphBase = shownTotal()
graphSeen = graphBase
WaylandCompositor.setGameListener(listener)
handler.postDelayed(tick, TICK_MS)
}
fun stop() {
running = false
handler.removeCallbacks(tick)
WaylandCompositor.clearGameListener(listener)
text = ""
graph = FloatArray(0)
}
private fun readOptions() {
showFps = SessionPrefs.hudShowFps(context)
showBattery = SessionPrefs.hudShowBattery(context)
showGraph = SessionPrefs.hudShowGraph(context)
}
private fun readout(fpsValue: Float): String {
val parts = ArrayList<String>(2)
if (showFps) parts.add(line(fpsValue))
if (showBattery) batteryCelsius(readBatteryDeci())?.let { parts.add(it) }
return parts.joinToString("\n")
}
private fun readBatteryDeci(): Int {
val sticky = runCatching {
context.registerReceiver(null, IntentFilter(Intent.ACTION_BATTERY_CHANGED))
}.getOrNull() ?: return 0
return sticky.getIntExtra(BatteryManager.EXTRA_TEMPERATURE, 0)
}
private fun shownTotal(): Long = try { WaylandCompositor.nativeHudFrameTimes(samples) } catch (t: Throwable) { 0L }
private fun clearGraph() {
graphBase = shownTotal()
graphSeen = graphBase
if (graph.isNotEmpty()) graph = FloatArray(0)
}
private fun publishGraph() {
val total = shownTotal()
if (total == graphSeen && graph.isNotEmpty()) return
graphSeen = total
graph = recent(samples, total, graphBase)
}
private fun line(base: Float): String {
val mode = FrameGen.mode(context)
if (mode.engine == FrameGen.ENGINE_OFF) return fps(base)
val lsfg = mode.engine == FrameGen.ENGINE_LSFG
val name = if (lsfg) "LSFG" else "DD-FG"
val label = FrameGen.label(context, mode)
if (lsfg && Lossless.cacheFile(context)?.isFile != true) return context.getString(R.string.hud_fg_needs_lossless, name)
val stats = try { WaylandCompositor.nativeFrameGenStats() } catch (t: Throwable) { null }
val problem = try { WaylandCompositor.nativeFrameGenProblem() } catch (t: Throwable) { -1 }
return when {
problem == 1 -> context.getString(R.string.hud_fg_unsupported, name)
problem == 2 -> context.getString(R.string.hud_fg_failed, name)
stats != null && stats[3] > 1f -> String.format(Locale.US, "%s %.0f → %.0f fps", label, base, stats[3])
else -> context.getString(R.string.hud_fg_starting, label, fps(base))
}
}
private fun fps(value: Float) = String.format(Locale.US, "%.0f fps", value)
companion object {
private const val TICK_MS = 1_000L
private const val GRAPH = 128
internal const val GRAPH_MAX_MS = 50f
internal fun recent(samples: FloatArray, total: Long, base: Long): FloatArray {
val filled = minOf(total, samples.size.toLong()).toInt()
val shown = minOf(filled.toLong(), (total - base).coerceAtLeast(0L)).toInt()
if (shown < 2) return FloatArray(0)
return FloatArray(shown) { samples[filled - shown + it].coerceIn(0f, GRAPH_MAX_MS) }
}
internal fun batteryCelsius(deci: Int): String? =
if (deci <= 0) null else String.format(Locale.US, "%.1f°C", deci / 10f)
}
}
@@ -74,6 +74,7 @@ object SessionFiles {
"usr/local/bin/droiddeck-steam-shortcuts" to "usr/local/bin/droiddeck-steam-shortcuts",
"usr/local/bin/droiddeck-xbox" to "usr/local/bin/droiddeck-xbox",
"usr/local/bin/droiddeck-store-launch" to "usr/local/bin/droiddeck-store-launch",
"usr/local/bin/droiddeck-gog-maintenance" to "usr/local/bin/droiddeck-gog-maintenance",
"usr/local/bin/droiddeck-battlenet" to "usr/local/bin/droiddeck-battlenet",
"usr/local/bin/droiddeck-epic" to "usr/local/bin/droiddeck-epic",
"usr/local/bin/droiddeck-epic-steam" to "usr/local/bin/droiddeck-epic-steam",
@@ -125,6 +125,24 @@ object SessionPrefs {
prefs(context).edit().putString("storesView", if (view in STORES_VIEWS) view else STORES_VIEWS.first()).apply()
}
fun libraryCardLevel(context: Context): Int = prefs(context).getInt("libraryCardLevel", 2)
fun setLibraryCardLevel(context: Context, level: Int) {
prefs(context).edit().putInt("libraryCardLevel", level).apply()
}
fun libraryShowTitle(context: Context): Boolean = prefs(context).getBoolean("libraryShowTitle", true)
fun setLibraryShowTitle(context: Context, show: Boolean) {
prefs(context).edit().putBoolean("libraryShowTitle", show).apply()
}
fun libraryShowSize(context: Context): Boolean = prefs(context).getBoolean("libraryShowSize", true)
fun setLibraryShowSize(context: Context, show: Boolean) {
prefs(context).edit().putBoolean("libraryShowSize", show).apply()
}
fun libraryShowUninstalled(context: Context): Boolean = prefs(context).getBoolean("libraryShowUninstalled", false)
fun setLibraryShowUninstalled(context: Context, show: Boolean) {
@@ -233,6 +251,20 @@ object SessionPrefs {
prefs(context).edit().putInt("hudOpacity", percent.coerceIn(HUD_OPACITY_RANGE)).apply()
}
fun fusionHudConfig(context: Context): String? = prefs(context).getString("fusionHud", null)
fun setFusionHudConfig(context: Context, config: String) {
prefs(context).edit().putString("fusionHud", config).apply()
}
fun fusionHudPosition(context: Context): Pair<Float, Float>? =
prefs(context).getString("fusionHudPos", null)?.split(',')?.mapNotNull { it.toFloatOrNull() }
?.takeIf { it.size == 2 }?.let { it[0] to it[1] }
fun setFusionHudPosition(context: Context, x: Float, y: Float) {
prefs(context).edit().putString("fusionHudPos", "$x,$y").apply()
}
const val HUD_COLOR_MINT = "mint"
val HUD_COLORS = listOf(HUD_COLOR_MINT, "white", "sky", "amber", "violet")
val HUD_OPACITY_RANGE = 30..100
@@ -1195,7 +1227,7 @@ object SessionPrefs {
resolutionChosen(context, SessionService.MODE_DESKTOP)) SessionService.MODE_DESKTOP
else prefMode(mode)
fun pipAutoEnter(context: Context): Boolean = prefs(context).getBoolean("pipAutoEnter", false)
fun pipAutoEnter(context: Context): Boolean = prefs(context).getBoolean("pipAutoEnter", true)
fun setPipAutoEnter(context: Context, enabled: Boolean) {
prefs(context).edit().putBoolean("pipAutoEnter", enabled).apply()
@@ -1238,7 +1270,8 @@ object SessionPrefs {
}
fun suspendPolicy(context: Context, mode: String): String =
prefs(context).getString("suspendPolicy.${prefMode(mode)}", SUSPEND_MANUAL)
prefs(context).getString("suspendPolicy.${prefMode(mode)}",
if (mode == SessionService.MODE_STEAM) SUSPEND_NATIVE else SUSPEND_MANUAL)
?.let { if (it == LEGACY_SUSPEND_DOWNLOADS) SUSPEND_AUTO else it }
?.takeIf { it in setOf(SUSPEND_AUTO, SUSPEND_NATIVE, SUSPEND_MANUAL, SUSPEND_NEVER) }
?.let { if (mode != SessionService.MODE_STEAM && it == SUSPEND_NATIVE) SUSPEND_AUTO else it }
@@ -14,7 +14,7 @@ object SettingsReset {
"orientation", "launcherFullscreen", "animations", "theme", "runSteamAtStartup", "addedGamesArt",
"gameStoresEnabled", "gameStoresSpeedTier", "gameStoresParallel", "storesOpenTab", "storesShowMature",
"storesInstallLanguage",
"hud", "hudDeck", "hudFps", "hudBattery", "hudGraph", "hudColor", "hudOpacity", "backActionsInverted", "backDoubleTapMs", "touch", "osc", "shape", "steamController",
"hud", "hudDeck", "hudFps", "hudBattery", "hudGraph", "hudColor", "hudOpacity", "fusionHud", "fusionHudPos", "backActionsInverted", "backDoubleTapMs", "touch", "osc", "shape", "steamController",
"gamepadLeft", "gamepadRight", "pipAutoEnter", "unfoldedControls", "unfoldedControlsWithController",
"stretch16x9", "picturePosition",
"gpuDriverMode", "androidDriver", "linuxDriver", "linuxDriver.steam", "linuxDriver.desktop",
@@ -19,7 +19,7 @@ enum class Bucket { GAMES, GAME_DATA, TOOLS, COMPONENTS, STORES, DESKTOP, SYSTEM
class GameUsage(
val appId: Int, val name: String, val art: File?, val library: String, val internal: Boolean, val lastPlayed: Long,
val game: Long, val prefix: Long, val shaders: Long, val workshop: Long, val shaderDir: File?,
val x64: Boolean = false,
val x64: Boolean = false, val prefixDir: File? = null,
) {
val data: Long get() = prefix + shaders + workshop
val total: Long get() = game + data
@@ -175,14 +175,16 @@ object StorageScan {
}
if (!m.installed) continue
val gameBytes = dir?.let { File(lib.root, "steamapps/common/$it") }?.takeIf { it.isDirectory }?.let { walker.measure(it) } ?: 0
val prefix = File(lib.data, "steamapps/compatdata/${m.appId}").takeIf { it.isDirectory }?.let { walker.measure(it) } ?: 0
val compatRoot = File(lib.data, "steamapps/compatdata").takeIf { it.isDirectory } ?: File(lib.root, "steamapps/compatdata")
val prefixDir = File(compatRoot, m.appId.toString()).takeIf { it.isDirectory }
val prefix = prefixDir?.let { walker.measure(it) } ?: 0
val shaderDir = File(lib.data, "steamapps/shadercache/${m.appId}").takeIf { it.isDirectory }
val shaders = shaderDir?.let { walker.measure(it) } ?: 0
val workshop = File(lib.root, "steamapps/workshop/content/${m.appId}").takeIf { it.isDirectory }?.let { walker.measure(it) } ?: 0
val known = art[lib.x64]?.get(m.appId)
games.add(GameUsage(
m.appId, known?.name ?: m.name, known?.art, lib.label, lib.internal, m.lastPlayed,
gameBytes, prefix, shaders, workshop, shaderDir, lib.x64,
gameBytes, prefix, shaders, workshop, shaderDir, lib.x64, prefixDir,
))
}
}
@@ -140,6 +140,13 @@ object StorageState {
FileOps.delete(dir)
})
fun resetPrefix(context: Context, game: GameUsage) = act(context, "prefix-${game.appId}", { _, fresh ->
val dir = fresh.games.firstOrNull { it.appId == game.appId && it.x64 == game.x64 && it.prefixDir?.path == game.prefixDir?.path }
?.prefixDir ?: error("prefix not found")
check(FileOps.delete(dir)) { "cannot delete $dir" }
true
})
fun removeLeftover(context: Context, l: Leftover) = act(context, "leftover-${l.appId}", { _, fresh ->
val leftover = fresh.leftovers.firstOrNull { it.appId == l.appId && it.prefix?.path == l.prefix?.path && it.shaders?.path == l.shaders?.path }
?: return@act false
@@ -254,6 +254,7 @@ object StoreInstallRoot {
val sidecar = StoreGameSidecar.read(folder)
when {
sidecar == null -> Unfinished(store, null, folder)
store == Store.GOG && sidecar.state == StoreGameSidecar.STATE_UPDATING -> null
!sidecar.isInstalled -> Unfinished(store, sidecar.id, folder)
else -> null
}
@@ -81,7 +81,7 @@ object StoresState {
runCatching { com.droiddeck.launcher.stores.battlenet.BattleNetClient.syncAccount(app) }
val found = Store.entries.mapNotNull { store -> StoreAccounts.displayName(app, store)?.let { store to it } }
val onDisk = StoreInstallRoot.gameFolders(app).mapNotNull { folder ->
StoreGameSidecar.read(folder)?.takeIf { it.isInstalled }?.let { InstalledStoreGame(it, folder) }
StoreGameSidecar.read(folder)?.takeIf { it.isInstalled || it.store == Store.GOG && it.state == StoreGameSidecar.STATE_UPDATING }?.let { InstalledStoreGame(it, folder) }
} + runCatching { com.droiddeck.launcher.stores.battlenet.BattleNetBackend.installedGames(app) }.getOrDefault(emptyList())
val partial = StoreInstallRoot.unfinished(app)
val version = if (StoresNative.available) StoresNative.version ?: "" else ""
@@ -95,6 +95,7 @@ object StoresState {
engine = version
accountsLoaded = true
}
com.droiddeck.launcher.stores.gog.GogMaintenance.checkInstalled(app, onDisk)
}
}
}
@@ -31,6 +31,9 @@ data class DownloadEntry(
val stageItemsTotal: Int = 0,
val diskBytes: Long = 0L,
val stagesPassed: Int = 0,
val interruptible: Boolean = true,
val reusedBytes: Long = 0L,
val appliedBytes: Long = 0L,
) {
fun passed(s: DownloadStage): Boolean = state == DownloadState.INSTALLED || (stagesPassed and (1 shl s.ordinal)) != 0
@@ -21,6 +21,11 @@ object DownloadQueue {
fun diskSize(bytes: Long) = update(key) { if (bytes > 0) it.copy(diskBytes = bytes) else it }
fun progress(bytesDone: Long, bytesTotal: Long, detail: String? = null, @Suppress("UNUSED_PARAMETER") speedBps: Long = -1L) = measure(key, bytesDone, bytesTotal, detail?.let(::stripSpeed))
fun log(line: String) = StoresState.logLine(line)
fun interruptible(value: Boolean) = update(key) {
check(value || !cancelled.get()) { "The operation was paused before installer application" }
it.copy(interruptible = value)
}
fun maintenance(reusedBytes: Long, appliedBytes: Long) = update(key) { it.copy(reusedBytes = reusedBytes, appliedBytes = appliedBytes) }
}
private fun stripSpeed(s: String): String = s.replace(Regex("\\s+\\S+ [KMG]B/s\\s*$"), "").trimEnd()
@@ -166,12 +171,13 @@ object DownloadQueue {
fun pause(key: String) {
val item = synchronized(lock) { items[key] } ?: return
synchronized(lock) {
if (!item.entry.interruptible) return
if (item.entry.state == DownloadState.QUEUED) { item.entry = item.entry.copy(state = DownloadState.PAUSED, queuePosition = 0); renumber(); publishLocked(); return }
if (item.entry.state != DownloadState.RUNNING) return
item.pauseRequested = true
item.cancelled.set(true)
item.job?.cancel(deleteFiles = false)
}
item.cancelled.set(true)
item.job?.cancel(deleteFiles = false)
StoresState.logLine("paused \"${item.entry.name}\"")
}
@@ -204,17 +210,19 @@ object DownloadQueue {
val wasRunning: Boolean
synchronized(lock) {
item = items[key] ?: return
if (!item.entry.interruptible) return
wasRunning = item.entry.state == DownloadState.RUNNING
if (wasRunning) {
item.cancelled.set(true)
item.job?.cancel(deleteFiles = true)
}
if (!wasRunning) {
item.entry = item.entry.copy(state = DownloadState.CANCELLED, queuePosition = 0, finishedAt = System.currentTimeMillis())
renumber()
publishLocked()
}
}
if (wasRunning) {
item.cancelled.set(true)
item.job?.cancel(deleteFiles = true)
} else {
if (!wasRunning) {
Thread({ runCatching { item.factory?.invoke()?.cancel(deleteFiles = true) } }, "store-dl-cancel").start()
}
StoresState.logLine("cancelled \"${item.entry.name}\"")
@@ -45,7 +45,7 @@ object SavedQueue {
val f = File(context.filesDir, FILE)
val tmp = File(context.filesDir, "$FILE.tmp")
tmp.writeText(out.toString())
tmp.renameTo(f)
java.nio.file.Files.move(tmp.toPath(), f.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING)
}.onFailure { Log.w(TAG, "could not save the queue", it) }
}
}
@@ -68,7 +68,12 @@ object SavedQueue {
for ((item, root, paused) in back) {
if (DownloadQueue.entry(key(item)) != null) continue
if (paused) DownloadQueue.holdPaused(key(item))
StoresState.install(app, item, root)
if (item.store == Store.GOG && item.extra.containsKey(com.droiddeck.launcher.stores.gog.GogMaintenance.OPERATION)) {
Thread({
runCatching { com.droiddeck.launcher.stores.gog.GogMaintenance.restore(app, item) }
.onFailure { DownloadQueue.recordFailed(app, DownloadEntry(item.store, item.id, item.title), it.message ?: "GOG recovery failed") }
}, "gog-restore").start()
} else StoresState.install(app, item, root)
}
}
}, "store-queue-restore").start()
@@ -33,6 +33,7 @@ object GogAuth {
@Synchronized
private fun saveAccount(context: Context, accessToken: String, refreshToken: String?, userId: String?) {
GogMaintenance.reset()
var username = ""
runCatching {
val body = StoreNet.get("https://embed.gog.com/userData.json", bearer = accessToken, userAgent = GALAXY_UA)
@@ -28,6 +28,7 @@ object GogBackend : StoreBackend {
}
override fun signOut(context: Context) {
GogMaintenance.reset()
GogPrefs.get(context).edit().remove("library_cache").remove("library_cache_v2").remove("library_synced_at").apply()
}
@@ -53,7 +54,11 @@ object GogBackend : StoreBackend {
StoresState.post {
StoresState.status.remove(store)
when (result) {
is GogLibrary.SyncResult.Ok -> { StoresState.library[store] = com.droiddeck.launcher.stores.mergeItems(StoresState.library[store], result.games.map { GogLibrary.toCatalogItem(app, it) }); StoresState.problems.remove(store) }
is GogLibrary.SyncResult.Ok -> {
StoresState.library[store] = com.droiddeck.launcher.stores.mergeItems(StoresState.library[store], result.games.map { GogLibrary.toCatalogItem(app, it) })
StoresState.problems.remove(store)
GogMaintenance.checkInstalled(app, StoresState.installed)
}
is GogLibrary.SyncResult.Failed -> StoresState.problems[store] = result.message
GogLibrary.SyncResult.NotLoggedIn -> StoresState.problems[store] = StoresState.notSignedInLine(store)
GogLibrary.SyncResult.Busy -> {}
@@ -0,0 +1,187 @@
package com.droiddeck.launcher.stores.gog
import android.content.Context
import com.droiddeck.launcher.stores.StoreLanguage
import com.droiddeck.launcher.stores.StoreNet
import org.json.JSONArray
import org.json.JSONObject
import java.net.HttpURLConnection
import java.net.URL
import java.util.zip.GZIPInputStream
import java.util.zip.InflaterInputStream
internal object GogContent {
const val SYSTEM = "https://content-system.gog.com"
const val CDN = "https://gog-cdn-fastly.gog.com/content-system"
fun token(context: Context) = GogAuth.validToken(context) ?: error("Sign in to GOG and retry")
fun builds(id: String, token: String): JSONObject {
val result = json("$SYSTEM/products/$id/os/windows/builds?generation=2", token)
if (result.optJSONArray("items")?.length() != 0) return result
return json("$SYSTEM/products/$id/os/windows/builds?generation=1", token)
}
fun product(id: String, token: String): JSONObject = json("https://api.gog.com/products/$id?expand=downloads", token)
fun downloadFilename(url: String): String = java.net.URLDecoder.decode(URL(url).path.substringAfterLast('/').replace("+", "%2B"), "UTF-8")
fun resolveDownload(download: GogOfflineDownload, token: String): GogOfflineDownload = download.copy(parts = download.parts.map { part ->
val resolved = GogDownloadManager.resolveRedirect(part.url, token) ?: error("The GOG download link is unavailable")
val connection = URL(resolved).openConnection() as HttpURLConnection
try {
connection.requestMethod = "HEAD"
connection.connectTimeout = 20_000; connection.readTimeout = 30_000
check(connection.responseCode in 200..299) { "GOG download metadata failed (HTTP ${connection.responseCode})" }
val disposition = connection.getHeaderField("Content-Disposition").orEmpty()
val supplied = Regex("filename=\"?([^\";]+)", RegexOption.IGNORE_CASE).find(disposition)?.groupValues?.get(1).orEmpty()
val remote = downloadFilename(resolved).takeIf { it.endsWith(".exe", true) || it.endsWith(".bin", true) }.orEmpty()
val name = part.name.ifBlank { supplied.ifBlank { remote } }
check(name.isNotBlank()) { "GOG did not provide the installer part filename" }
part.copy(name = name, size = connection.contentLengthLong.coerceAtLeast(0))
} finally { connection.disconnect() }
})
fun json(url: String, token: String? = null): JSONObject {
require(URL(url).protocol == "https") { "GOG metadata requires HTTPS" }
val connection = URL(url).openConnection() as HttpURLConnection
try {
connection.connectTimeout = 20_000; connection.readTimeout = 30_000
connection.setRequestProperty("User-Agent", GogAuth.GALAXY_UA)
if (token != null && URL(url).host.let { it == "gog.com" || it.endsWith(".gog.com") }) connection.setRequestProperty("Authorization", "Bearer $token")
check(connection.responseCode in 200..299) { "GOG metadata request failed (HTTP ${connection.responseCode})" }
val raw = connection.inputStream.readBytes()
val text = when {
raw.size > 1 && raw[0] == 0x78.toByte() -> InflaterInputStream(raw.inputStream()).bufferedReader().use { it.readText() }
raw.size > 1 && raw[0] == 0x1f.toByte() && raw[1] == 0x8b.toByte() -> GZIPInputStream(raw.inputStream()).bufferedReader().use { it.readText() }
else -> raw.toString(Charsets.UTF_8)
}
return JSONObject(text)
} finally { connection.disconnect() }
}
fun snapshot(old: GogInstallRecord, build: GogBuild, token: String,
metadata: (String, String?) -> JSONObject = ::json): GogInstallRecord {
check(build.link.isNotBlank()) { "GOG build manifest is unavailable" }
val manifest = metadata(build.link, token)
val files = JSONArray()
val depots = if (build.generation == 1) manifest.optJSONObject("product")?.optJSONArray("depots") ?: manifest.optJSONArray("depot") else manifest.optJSONArray("depots")
check(depots != null) { "GOG build has no depot list" }
val resolvedLanguage = StoreLanguage.pick(StoreLanguage.codesFromDepots(depots), old.language)
val selectedBitness = if (depots.objects().any { it.optJSONArray("osBitness")?.strings()?.contains("64") == true }) "64" else "32"
val owned = if (old.products.any { it != old.id }) StoreNet.get("https://embed.gog.com/user/data/games", bearer = token)?.let { JSONObject(it).optJSONArray("owned")?.strings()?.toSet() } else emptySet()
val products = old.products.filter { it == old.id || owned?.contains(it) == true }
check(old.products.all { it == old.id || owned?.contains(it) == true }) { "Could not confirm ownership of installed GOG DLC" }
for (depot in depots.objects()) {
if (depot.has("redist")) continue
val ids = depot.optJSONArray("gameIDs")?.strings() ?: listOf(depot.optString("productId", old.id))
val product = ids.firstOrNull { it in products } ?: continue
val languages = depot.optJSONArray("languages")?.strings().orEmpty()
if (!languageSelected(languages, resolvedLanguage)) continue
val bitness = depot.optJSONArray("osBitness")?.strings().orEmpty()
if (bitness.isNotEmpty() && selectedBitness !in bitness) continue
val hash = depot.optString("manifest")
val content = when {
hash.isNotEmpty() && build.generation == 2 -> metadata("$CDN/v2/meta/${cdnPath(hash)}", null)
hash.isNotEmpty() -> {
val timestamp = manifest.getJSONObject("product").getString("timestamp")
metadata("$CDN/v1/manifests/$product/windows/$timestamp/$hash", token)
}
depot.has("files") -> JSONObject().put("depot", depot)
else -> error("GOG depot manifest is missing")
}
val entries = content.getJSONObject("depot").optJSONArray(if (build.generation == 2) "items" else "files") ?: error("GOG depot files are missing")
for (entry in entries.objects()) {
val type = entry.optString("type")
check(type != "DepotLink") { "This GOG build contains unsupported file links" }
val support = depot.optBoolean("support") || entry.optBoolean("support") || entry.optJSONArray("flags")?.strings()?.contains("support") == true
val relative = entry.getString("path").replace('\\', '/').trimEnd('/').let { if (build.generation == 1) it.trimStart('/') else it }
val path = if (support) (if (build.generation == 1) "support/$relative" else "support/$product/$relative") else relative
val directory = type == "DepotDirectory" || entry.has("directory")
val chunks = entry.optJSONArray("chunks") ?: JSONArray()
val size = if (build.generation == 2) chunks.objects().sumOf { it.optLong("size") } else entry.optLong("size")
files.put(JSONObject().put("path", path).put("size", size).put("directory", directory)
.put("md5", entry.optString("md5").ifBlank { entry.optString("hash") }.takeIf { it.matches(Regex("[a-fA-F0-9]{32}")) }.orEmpty())
.put("sha256", entry.optString("sha256")).put("chunks", chunks).put("product", product)
.put("offset", entry.optLong("offset")).put("remotePath", entry.optString("url").substringBefore('?')))
}
}
check(files.length() > 0) { "GOG build contains no matching files" }
return old.copy(source = "depot", generation = build.generation, build = build.id, version = build.version,
branch = build.branch, language = resolvedLanguage, manifest = sanitize(manifest), files = files, products = products, verified = true)
}
fun languageSelected(list: List<String>, selected: String): Boolean = list.any { it.equals("Neutral", true) } || StoreLanguage.depotMatchesResolved(list.toTypedArray(), selected)
fun cdnPath(hash: String): String {
require(hash.matches(Regex("[a-fA-F0-9]{32,64}"))) { "Invalid GOG content hash" }
return "${hash.take(2)}/${hash.substring(2, 4)}/$hash"
}
fun links(record: GogInstallRecord, token: String, patches: Boolean = false): JSONObject {
val out = JSONObject()
for (id in record.products) {
val path = if (record.generation == 1) "/windows/${record.manifest.optJSONObject("product")?.optString("timestamp")}/" else "/"
val query = "_version=2&" + (if (record.generation == 1) "type=depot" else "generation=2") + "&path=${java.net.URLEncoder.encode(path, "UTF-8")}" + if (patches) "&root=%2Fpatches%2Fstore" else ""
val response = json("$SYSTEM/products/$id/secure_link?$query", token)
val bases = response.optJSONArray("urls")?.objects().orEmpty().mapNotNull { item ->
val params = item.optJSONObject("parameters")
var url = item.optString("url_format")
params?.keys()?.forEach { key -> url = url.replace("{$key}", params.getString(key)) }
url.takeIf { it.startsWith("https://") }
}
check(bases.isNotEmpty()) { "GOG refused a download link" }
out.put(id, JSONArray(bases))
}
return out
}
fun patches(old: GogInstallRecord, target: GogInstallRecord, token: String): JSONArray {
if (old.generation != 2 || target.generation != 2 || old.build.isBlank() || old.build == target.build) return JSONArray()
return runCatching {
val index = json("$SYSTEM/products/${old.id}/patches?_version=4&from_build_id=${old.build}&to_build_id=${target.build}", token)
val meta = json(index.getString("link"), token)
if (meta.optString("algorithm") != "xdelta3") return@runCatching JSONArray()
val result = JSONArray()
for (depot in meta.getJSONArray("depots").objects()) {
if (depot.optString("productId") !in target.products || !languageSelected(depot.optJSONArray("languages")?.strings().orEmpty(), target.language)) continue
val data = json("$CDN/v2/patches/meta/${cdnPath(depot.getString("manifest"))}")
for (item in data.getJSONObject("depot").getJSONArray("items").objects()) if (item.optString("type") == "DepotDiff")
result.put(JSONObject(item.toString()).put("product", depot.getString("productId")))
}
result
}.getOrElse { JSONArray() }
}
fun setupFiles(record: GogInstallRecord, token: String): Pair<JSONArray, JSONObject>? {
if (!record.manifest.optBoolean("scriptInterpreter")) return null
if (record.files.objects().none { file -> record.products.any { file.optString("path").substringAfterLast('/') == "goggame-$it.script" } }) return null
val index = json("$SYSTEM/dependencies/repository?generation=2")
val repository = json(index.getString("repository_manifest"))
val depot = repository.getJSONArray("depots").objects().firstOrNull { it.optString("dependencyId") == "ISI" }
?: error("GOG setup interpreter is unavailable")
val content = json("$CDN/v2/dependencies/meta/${cdnPath(depot.getString("manifest"))}")
val files = JSONArray()
for (entry in content.getJSONObject("depot").getJSONArray("items").objects()) {
if (entry.optString("type") != "DepotFile") continue
val chunks = entry.getJSONArray("chunks")
files.put(JSONObject().put("path", "support/" + entry.getString("path").replace('\\', '/'))
.put("size", chunks.objects().sumOf { it.getLong("size") }).put("md5", entry.optString("md5"))
.put("chunks", chunks).put("product", "redist"))
}
val response = json("$SYSTEM/open_link?generation=2&_version=2&path=%2Fdependencies%2Fstore%2F", token)
val bases = GogDownloadManager.parseCdnUrls(response.toString())
check(bases.isNotEmpty()) { "GOG setup download links are unavailable" }
return files to JSONObject().put("redist", JSONArray(bases))
}
fun sanitize(value: JSONObject): JSONObject {
val result = JSONObject()
for (key in value.keys()) {
if (key.lowercase() in setOf("clientsecret", "access_token", "refresh_token", "link", "urls", "url")) continue
val v = value.get(key)
result.put(key, when (v) { is JSONObject -> sanitize(v); is JSONArray -> JSONArray((0 until v.length()).map { i -> v.get(i).let { if (it is JSONObject) sanitize(it) else it } }); else -> v })
}
return result
}
}
@@ -106,7 +106,7 @@ public final class GogDownloadManager {
String builds1Json = httpGet(builds1Url, null);
if (builds1Json == null) builds1Json = httpGet(builds1Url, token);
if (builds1Json == null) throw new InstallException("No builds available for this game");
Gen1Outcome one = runGen1(ctx, game, token, builds1Json, installPath, cb, cancelled);
Gen1Outcome one = runGen1(ctx, game, token, builds1Json, installPath, cb, cancelled, lang);
if (one.result != null || cancelled.get()) return one.result;
if (!"NO_CS_BUILDS".equals(one.error)) throw new InstallException("Download failed: " + one.error);
cb.onProgress("No Galaxy builds; fetching the installer…", 12);
@@ -250,6 +250,11 @@ public final class GogDownloadManager {
if (anyFailed.get()) { out.error = "one or more chunks failed to download"; return out; }
cb.onProgress("Finishing…", 96);
try {
GogMaintenance.captureDepot(game.gameId, installPath, gm.buildId, buildsJson, manifest, new JSONArray(depotJsons), resolved);
} catch (Exception e) {
cb.onLog("gog: maintenance inventory not recorded: " + e.getMessage());
}
writeFile(new File(installPath, MARKER), ("{\"gameId\":\"" + game.gameId + "\",\"buildId\":\"" + gm.buildId + "\"}").getBytes("UTF-8"));
deleteCounted(new File(installPath, ".gog_chunks"), cb);
String clientId = manifest.optString("clientId", null);
@@ -279,7 +284,7 @@ public final class GogDownloadManager {
String buildId = null, manifestUrl = null;
for (int i = 0; i < items.length(); i++) {
JSONObject item = items.getJSONObject(i);
if ("windows".equals(item.optString("os"))) {
if ("windows".equals(item.optString("os")) && (item.isNull("branch") || item.optString("branch").isEmpty())) {
buildId = item.optString("build_id");
manifestUrl = item.optString("link");
if (manifestUrl == null || manifestUrl.isEmpty()) manifestUrl = item.optString("meta_url");
@@ -328,7 +333,7 @@ public final class GogDownloadManager {
private static final class Gen1Outcome { Result result; String error; }
private static Gen1Outcome runGen1(Context ctx, GogGame game, String token, String buildsJson, File installPath, Callback cb, AtomicBoolean cancelled) {
private static Gen1Outcome runGen1(Context ctx, GogGame game, String token, String buildsJson, File installPath, Callback cb, AtomicBoolean cancelled, String language) {
Gen1Outcome out = new Gen1Outcome();
try {
JSONObject builds = new JSONObject(buildsJson);
@@ -346,6 +351,15 @@ public final class GogDownloadManager {
String manifestStr = decompressBytes(raw);
if (manifestStr == null) { out.error = "manifest decompress failed"; return out; }
JSONObject manifest = new JSONObject(manifestStr);
if (manifest.has("product")) {
try {
out.result = GogMaintenance.installContent(ctx, game, installPath, builds, language, cb, cancelled);
if (out.result == null && !cancelled.get()) out.error = "no usable public Windows build";
} catch (Exception e) {
out.error = e.getMessage() == null ? e.getClass().getSimpleName() : e.getMessage();
}
return out;
}
JSONArray depots = manifest.optJSONArray("depot");
if (depots == null) { out.error = "no depot array"; return out; }
List<Gen1File> files = new ArrayList<>();
@@ -472,6 +486,7 @@ public final class GogDownloadManager {
String exe = pickExe(installPath, null, game.title);
if (exe.isEmpty()) throw new InstallException("The installer was extracted but no game executable was found");
cb.onLog("gog: installer extracted natively; game exe " + exe);
GogMaintenance.captureOffline(game.gameId, installPath, downloads);
return new Result(exe, "", total);
} catch (InstallerException e) {
throw e;
@@ -576,13 +591,13 @@ public final class GogDownloadManager {
return cleaned.isEmpty() ? "game" : cleaned;
}
private static String resolveRedirect(String url, String token) {
static String resolveRedirect(String url, String token) {
try {
if (url.startsWith("/")) url = "https://www.gog.com" + url;
for (int hop = 0; hop < 5; hop++) {
HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection();
conn.setConnectTimeout(TIMEOUT); conn.setReadTimeout(TIMEOUT); conn.setInstanceFollowRedirects(false);
if (token != null) conn.setRequestProperty("Authorization", "Bearer " + token);
if (token != null && (new URL(url).getHost().equals("gog.com") || new URL(url).getHost().endsWith(".gog.com"))) conn.setRequestProperty("Authorization", "Bearer " + token);
int code = conn.getResponseCode();
String location = conn.getHeaderField("Location");
if (code == 301 || code == 302 || code == 303 || code == 307 || code == 308) {
@@ -686,6 +701,7 @@ public final class GogDownloadManager {
cb.onBytes(shown, planned, speedBps.get());
}
@Override public void onLog(String line) { cb.onLog(line); }
@Override public void onMaintenance(long networkBytes, long reusedBytes, long appliedBytes) {}
@Override public void onComplete(boolean success, boolean wasCancelled, boolean linkExpiry, String error, long bytesWritten, int filesDone) {
okRef.set(success); linkExpiryRef.set(linkExpiry); errRef.set(error == null ? "" : error); latch.countDown();
}
@@ -0,0 +1,58 @@
package com.droiddeck.launcher.stores.gog
import org.json.JSONArray
import org.json.JSONObject
import java.io.File
import java.io.RandomAccessFile
import java.security.MessageDigest
internal object GogEstimate {
data class Size(val download: Long, val required: Long)
private data class Chunk(val file: File, val offset: Long)
fun range(file: File, offset: Long, size: Long, md5: String): Boolean {
if (!file.isFile || offset < 0 || size < 0 || file.length() < offset + size || !md5.matches(Regex("[a-fA-F0-9]{32}"))) return false
return runCatching {
RandomAccessFile(file, "r").use { input ->
input.seek(offset)
val digest = MessageDigest.getInstance("MD5"); val buffer = ByteArray(64 * 1024); var left = size
while (left > 0) { val n = input.read(buffer, 0, minOf(left, buffer.size.toLong()).toInt()); check(n > 0); digest.update(buffer, 0, n); left -= n }
digest.digest().joinToString("") { "%02x".format(it) }.equals(md5, true)
}
}.getOrDefault(false)
}
fun calculate(folder: File, old: GogInstallRecord, target: GogInstallRecord, patches: JSONArray, reuseChunks: Boolean = true): Size {
val reusable = HashMap<Pair<String, Long>, MutableList<Chunk>>()
for (file in old.files.objects()) {
val source = GogFiles.inside(folder, file.getString("path")); var offset = 0L
for (chunk in file.optJSONArray("chunks")?.objects().orEmpty()) {
reusable.getOrPut(chunk.optString("md5").lowercase() to chunk.optLong("size")) { ArrayList() }.add(Chunk(source, offset))
offset += chunk.optLong("size")
}
}
var download = 0L; var required = 0L
for (file in target.files.objects()) {
if (file.optBoolean("directory") || GogFiles.matches(folder, file)) continue
val chunks = file.optJSONArray("chunks")?.objects().orEmpty()
val stamp = MessageDigest.getInstance("MD5").digest(file.getString("path").toByteArray()).joinToString("") { "%02x".format(it) }
val stage = File(GogFiles.dir(folder), "stage/$stamp")
var offset = 0L
var cost = if (chunks.isEmpty()) file.getLong("size") else chunks.sumOf { chunk ->
val size = chunk.getLong("size"); val hash = chunk.getString("md5")
val exists = reuseChunks && (range(stage, offset, size, hash) || reusable[hash.lowercase() to size].orEmpty().any { range(it.file, it.offset, size, hash) })
offset += size
if (exists) 0L else chunk.optLong("compressedSize")
}
val patch = patches.objects().firstOrNull { it.optString("path_target").replace('\\', '/') == file.getString("path") }
if (reuseChunks && patch != null) {
val source = GogFiles.inside(folder, patch.getString("path_source").replace('\\', '/'))
val delta = patch.getJSONArray("chunks").objects().sumOf { it.optLong("compressedSize") }
if (delta < cost && source.isFile && GogFiles.hash(source).equals(patch.getString("md5_source"), true)) cost = delta
}
download = Math.addExact(download, cost)
required = Math.addExact(required, maxOf(0, file.getLong("size") - stage.length()) + cost)
}
return Size(download, required)
}
}
@@ -0,0 +1,115 @@
package com.droiddeck.launcher.stores.gog
import com.droiddeck.launcher.stores.download.DownloadQueue
import com.droiddeck.launcher.stores.download.DownloadStage
import org.json.JSONObject
import java.io.File
import java.io.FileOutputStream
import java.net.HttpURLConnection
import java.net.URL
import java.util.concurrent.atomic.AtomicBoolean
import java.util.zip.InflaterInputStream
internal object GogFallback {
fun transfer(folder: File, plan: JSONObject, handle: DownloadQueue.JobHandle?, stop: AtomicBoolean,
callback: GogDownloadManager.Callback? = null) {
val stageRoot = File(GogFiles.dir(folder), "stage").apply { mkdirs() }
val files = plan.getJSONArray("files")
GogFiles.validate(files, folder)
var wire = 0L
fun progress(n: Int) { wire += n; handle?.progress(wire, plan.optLong("downloadBytes").coerceAtLeast(wire)); callback?.onBytes(wire, plan.optLong("downloadBytes").coerceAtLeast(wire), 0) }
for ((index, item) in files.objects().withIndex()) {
if (stop.get()) return
val destination = GogFiles.inside(folder, item.getString("path"))
if (item.optBoolean("directory")) { java.nio.file.Files.createDirectories(destination.toPath()); continue }
if (GogFiles.matches(folder, item)) continue
val stage = File(stageRoot, java.security.MessageDigest.getInstance("MD5").digest(item.getString("path").toByteArray()).joinToString("") { "%02x".format(it) })
val chunks = item.optJSONArray("chunks")?.objects().orEmpty()
FileOutputStream(stage).use { output ->
if (chunks.isNotEmpty()) {
for (chunk in chunks) {
if (stop.get()) return
val packed = File(stageRoot, "${stage.name}.packed")
val urls = endpoints(plan.getJSONObject("links"), item.getString("product"), GogContent.cdnPath(chunk.getString("compressedMd5")))
download(urls, packed, chunk.getLong("compressedSize"), stop, ::progress)
check(GogFiles.hash(packed).equals(chunk.getString("compressedMd5"), true)) { "GOG compressed chunk checksum mismatch" }
val digest = java.security.MessageDigest.getInstance("MD5")
var count = 0L
packed.inputStream().buffered().use { raw ->
raw.mark(2); val first = raw.read(); raw.reset()
val stored = chunk.getLong("size") == chunk.getLong("compressedSize") && chunk.getString("md5").equals(chunk.getString("compressedMd5"), true)
val input = if (!stored && first == 0x78) InflaterInputStream(raw) else raw
val buffer = ByteArray(64 * 1024)
while (true) {
if (stop.get()) return
val n = input.read(buffer); if (n < 0) break
count += n; check(count <= chunk.getLong("size")) { "GOG chunk exceeds expected size" }
digest.update(buffer, 0, n); output.write(buffer, 0, n)
}
}
check(count == chunk.getLong("size") && digest.digest().joinToString("") { "%02x".format(it) }.equals(chunk.getString("md5"), true)) { "GOG chunk checksum mismatch" }
packed.delete()
}
} else if (item.getLong("size") > 0) {
val remote = item.getString("remotePath")
val urls = if (remote.startsWith("https://")) listOf(remote) else endpoints(plan.getJSONObject("links"), item.getString("product"), remote.trimStart('/'))
val range = item.getLong("offset")
val raw = File(stageRoot, "${stage.name}.range")
download(urls, raw, item.getLong("size"), stop, ::progress, range)
raw.inputStream().use { it.copyTo(output) }; raw.delete()
}
output.fd.sync()
}
if (stop.get()) return
check(stage.length() == item.getLong("size")) { "GOG file size mismatch" }
if (item.optString("md5").isNotBlank()) check(GogFiles.hash(stage).equals(item.getString("md5"), true)) { "GOG file checksum mismatch" }
if (item.optString("sha256").isNotBlank()) check(GogFiles.hash(stage, "SHA-256").equals(item.getString("sha256"), true)) { "GOG file checksum mismatch" }
destination.parentFile!!.mkdirs()
GogFiles.inside(folder, item.getString("path"))
GogFiles.replace(stage, destination)
handle?.stage(DownloadStage.INSTALL); handle?.stageProgress((index + 1).toLong(), files.length().toLong())
callback?.onProgress("Downloading: ${destination.name}", ((index + 1) * 100 / files.length()))
}
val targetPaths = files.objects().mapTo(HashSet()) { it.getString("path").lowercase(java.util.Locale.ROOT) }
for (old in plan.optJSONArray("oldFiles")?.objects().orEmpty()) {
if (stop.get()) return
if (old.getString("path").lowercase(java.util.Locale.ROOT) !in targetPaths && GogFiles.matches(folder, old))
check(GogFiles.inside(folder, old.getString("path")).delete()) { "Could not remove obsolete GOG file" }
}
}
fun endpoints(links: JSONObject, product: String, path: String): List<String> = links.getJSONArray(product).strings().map { base ->
if (base.contains("{GALAXY_PATH}")) base.replace("{GALAXY_PATH}", path)
else base.substringBefore('?').trimEnd('/') + "/" + path + if ('?' in base) "?" + base.substringAfter('?') else ""
}
fun download(urls: List<String>, destination: File, size: Long, stop: AtomicBoolean, progress: (Int) -> Unit, range: Long? = null) {
var failure: Throwable? = null
for (attempt in 0..2) for (url in urls) {
if (stop.get()) return
val connection = URL(url).openConnection() as HttpURLConnection
try {
check(URL(url).protocol == "https" || URL(url).host in setOf("127.0.0.1", "localhost"))
connection.connectTimeout = 20_000; connection.readTimeout = 30_000
if (range != null) connection.setRequestProperty("Range", "bytes=$range-${range + size - 1}")
check(connection.responseCode == if (range == null) 200 else 206) { "GOG download failed (HTTP ${connection.responseCode})" }
FileOutputStream(destination).use { output ->
connection.inputStream.use { input ->
val buffer = ByteArray(64 * 1024); var count = 0L
while (true) {
if (stop.get()) return
val n = input.read(buffer); if (n < 0) break
count += n; check(size <= 0 || count <= size) { "GOG response exceeds expected size" }
output.write(buffer, 0, n); progress(n)
}
check(size <= 0 || count == size) { "Incomplete GOG download" }
}
output.fd.sync()
}
return
} catch (e: Exception) { failure = e }
finally { connection.disconnect() }
}
throw failure ?: IllegalStateException("No GOG download URL")
}
}
@@ -0,0 +1,176 @@
package com.droiddeck.launcher.stores.gog
import com.droiddeck.launcher.stores.StoreGameSidecar
import org.json.JSONArray
import org.json.JSONObject
import java.io.File
import java.io.FileOutputStream
import java.nio.file.Files
import java.nio.file.LinkOption
import java.nio.file.StandardCopyOption
import java.security.MessageDigest
import java.util.Locale
internal enum class GogOperation { UPDATE, REPAIR, PATCH, REFRESH }
internal data class GogInstallRecord(
val id: String,
val source: String,
val generation: Int = 0,
val build: String = "",
val version: String = "",
val branch: String = "",
val language: String = "en-US",
val products: List<String> = listOf(id),
val manifest: JSONObject = JSONObject(),
val files: JSONArray = JSONArray(),
val verified: Boolean = true,
) {
fun json() = JSONObject().put("schema", 1).put("id", id).put("source", source)
.put("generation", generation).put("build", build).put("version", version).put("branch", branch)
.put("language", language).put("products", JSONArray(products)).put("manifest", manifest)
.put("files", files).put("verified", verified)
fun write(folder: File) = GogFiles.write(File(GogFiles.dir(folder), "installed.json"), json())
companion object {
fun parse(o: JSONObject): GogInstallRecord {
require(o.optInt("schema") == 1) { "Unsupported GOG installation record" }
return GogInstallRecord(o.getString("id"), o.getString("source"), o.optInt("generation"),
o.optString("build"), o.optString("version"), o.optString("branch"), o.optString("language", "en-US"),
o.optJSONArray("products")?.strings().orEmpty().ifEmpty { listOf(o.getString("id")) },
o.optJSONObject("manifest") ?: JSONObject(), o.optJSONArray("files") ?: JSONArray(), o.optBoolean("verified", true))
}
fun read(folder: File): GogInstallRecord? = GogFiles.read(File(GogFiles.dir(folder), "installed.json"))?.let(::parse)
fun authenticBuild(folder: File, id: String): String = GogFiles.read(File(folder, "goggame-$id.id"))?.optString("buildId").orEmpty()
.ifBlank { GogFiles.read(File(folder, "goggame-$id.info"))?.optString("buildId").orEmpty() }
fun migrate(folder: File, sidecar: StoreGameSidecar): GogInstallRecord {
read(folder)?.let { require(it.id == sidecar.id); return it }
val legacy = GogFiles.read(File(folder, "_gog_manifest.json"))
val info = GogFiles.read(File(folder, "goggame-${sidecar.id}.info"))
val build = authenticBuild(folder, sidecar.id).ifBlank { legacy?.optString("buildId").orEmpty().ifBlank { sidecar.installVersion } }
val ids = folder.listFiles().orEmpty().mapNotNull { Regex("goggame-([0-9]+)\\.info").matchEntire(it.name)?.groupValues?.get(1) }
return GogInstallRecord(sidecar.id, if (legacy != null || sidecar.installVersion.isNotBlank()) "depot" else "offline",
legacy?.optInt("generation", if (build.isNotBlank()) 2 else 0) ?: if (build.isNotBlank()) 2 else 0,
build, info?.optString("versionName").orEmpty(), language = sidecar.extra[com.droiddeck.launcher.stores.StoreLanguage.EXTRA] ?: "en-US",
products = (listOf(sidecar.id) + ids).distinct()).also { it.write(folder) }
}
}
}
internal object GogFiles {
fun dir(folder: File): File = inside(folder, ".droiddeck-gog").apply { mkdirs() }
fun journal(folder: File): File = File(dir(folder), "operation.json")
fun inside(root: File, raw: String): File {
val path = raw.replace('\\', '/')
require(path.isNotBlank() && !path.startsWith('/') && ':' !in path && '\u0000' !in path &&
path.split('/').none { it.isEmpty() || it == "." || it == ".." }) { "Invalid GOG path: $raw" }
val base = root.canonicalFile
var out = base
for (part in path.split('/')) {
out = File(out, part)
require(!Files.isSymbolicLink(out.toPath())) { "GOG path is a symbolic link: $raw" }
}
require(out.canonicalFile.toPath().startsWith(base.toPath())) { "GOG path leaves installation" }
return out
}
fun read(file: File): JSONObject? {
require(!Files.isSymbolicLink(file.toPath())) { "GOG metadata is a symbolic link" }
return if (!file.exists()) null else JSONObject(file.readText())
}
fun write(file: File, value: JSONObject) {
require(!Files.isSymbolicLink(file.toPath()))
file.parentFile!!.mkdirs()
val tmp = File.createTempFile(".gog-", ".stage", file.parentFile)
try {
FileOutputStream(tmp).use { it.write(value.toString().toByteArray(Charsets.UTF_8)); it.fd.sync() }
replace(tmp, file)
} finally { tmp.delete() }
}
fun replace(from: File, to: File) {
require(!Files.isSymbolicLink(to.toPath()))
try { Files.move(from.toPath(), to.toPath(), StandardCopyOption.ATOMIC_MOVE, StandardCopyOption.REPLACE_EXISTING) }
catch (_: java.nio.file.AtomicMoveNotSupportedException) { Files.move(from.toPath(), to.toPath(), StandardCopyOption.REPLACE_EXISTING) }
}
fun hash(file: File, algorithm: String = "MD5"): String {
val digest = MessageDigest.getInstance(algorithm)
file.inputStream().use { input -> val buffer = ByteArray(128 * 1024); while (true) { val n = input.read(buffer); if (n < 0) break; digest.update(buffer, 0, n) } }
return digest.digest().joinToString("") { "%02x".format(it) }
}
fun matches(folder: File, file: JSONObject): Boolean {
val f = inside(folder, file.getString("path"))
if (!Files.isRegularFile(f.toPath(), LinkOption.NOFOLLOW_LINKS) || f.length() != file.getLong("size")) return false
val md5 = file.optString("md5")
if (md5.matches(Regex("[a-fA-F0-9]{32}"))) return hash(f).equals(md5, true)
val sha = file.optString("sha256")
if (sha.isNotBlank()) return hash(f, "SHA-256").equals(sha, true)
val chunks = file.optJSONArray("chunks")?.objects().orEmpty()
var offset = 0L
return chunks.isNotEmpty() && chunks.all { chunk ->
val result = GogEstimate.range(f, offset, chunk.getLong("size"), chunk.getString("md5"))
offset += chunk.getLong("size"); result
} || f.length() == 0L
}
fun validate(files: JSONArray, folder: File) {
val paths = HashSet<String>()
val components = HashMap<String, String>()
for (file in files.objects()) {
val path = file.getString("path").replace('\\', '/')
inside(folder, path)
require(!path.startsWith(".droiddeck-", true) && path != StoreGameSidecar.FILE_NAME) { "GOG content overlaps launcher metadata" }
require(paths.add(path.lowercase(Locale.ROOT))) { "GOG paths differ only by case: $path" }
var parent = folder
var relative = ""
for (part in path.split('/')) {
relative = if (relative.isEmpty()) part else "$relative/$part"
val previous = components.putIfAbsent(relative.lowercase(Locale.ROOT), relative)
require(previous == null || previous == relative) { "GOG directory paths differ only by case: $path" }
require(parent.list()?.none { it != part && it.equals(part, true) } != false) { "An existing path differs only by case: $path" }
parent = File(parent, part)
}
}
}
}
internal fun JSONArray.objects(): List<JSONObject> = (0 until length()).map { getJSONObject(it) }
internal fun JSONArray.strings(): List<String> = (0 until length()).map { optString(it) }
internal data class GogBuild(val id: String, val version: String, val generation: Int, val branch: String, val link: String) {
companion object {
fun select(builds: JSONObject, pinned: String = "", branch: String = ""): GogBuild? {
val items = builds.optJSONArray("items")?.objects().orEmpty().filter { it.optString("os", "windows") == "windows" }
val item = if (pinned.isNotBlank()) items.firstOrNull { it.optString("build_id") == pinned || it.optString("legacy_build_id") == pinned }
else items.firstOrNull { it.optString("branch").let { b -> (if (b == "null") "" else b) == branch } }
return item?.let { GogBuild(it.optString("build_id"), it.optString("version_name"), it.optInt("generation", 2),
it.optString("branch").let { b -> if (b == "null") "" else b },
it.optString("link").ifBlank { it.optString("meta_url").ifBlank { it.optJSONArray("urls")?.optJSONObject(0)?.optString("url").orEmpty() } }) }
}
}
}
internal data class GogOfflinePart(val id: String, val name: String, val url: String, val size: Long, val md5: String)
internal data class GogOfflineDownload(val id: String, val name: String, val version: String, val language: String, val parts: List<GogOfflinePart>) {
val size: Long get() = parts.sumOf { it.size }
companion object {
fun parse(downloads: JSONObject, kind: String): List<GogOfflineDownload> = downloads.optJSONArray(kind)?.objects().orEmpty()
.filter { it.optString("os") == "windows" }.mapNotNull { entry ->
val files = entry.optJSONArray("files")?.objects().orEmpty()
val parts = files.mapNotNull { f ->
val url = f.optString("downlink").ifBlank { f.optString("manualUrl") }
if (url.isBlank()) null else GogOfflinePart(f.optString("id"), f.optString("filename"), url, f.optLong("size"), f.optString("md5"))
}
if (parts.isEmpty()) null else GogOfflineDownload(entry.optString("id").ifBlank { parts.first().id },
entry.optString("name", "GOG download"), entry.optString("version"), entry.optString("language"), parts)
}
}
}
@@ -0,0 +1,415 @@
package com.droiddeck.launcher.stores.gog
import android.content.Context
import androidx.compose.runtime.mutableStateMapOf
import com.droiddeck.launcher.agent.AgentGuest
import com.droiddeck.launcher.frontend.AddedGames
import com.droiddeck.launcher.runtime.GuestCommand
import com.droiddeck.launcher.session.SessionPrefs
import com.droiddeck.launcher.session.SessionState
import com.droiddeck.launcher.stores.*
import com.droiddeck.launcher.stores.download.*
import org.json.JSONArray
import org.json.JSONObject
import java.io.File
import java.io.RandomAccessFile
import java.util.concurrent.CountDownLatch
import java.util.concurrent.Executors
import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicBoolean
internal object GogMaintenance {
enum class State { UNKNOWN, CHECKING, CURRENT, AVAILABLE, FAILED }
data class Check(val state: State, val version: String = "", val reason: String = "")
data class Proposal(val folder: File, val before: GogInstallRecord, val target: GogInstallRecord,
val operation: GogOperation, val downloadBytes: Long, val diskBytes: Long, val patch: GogOfflineDownload? = null, val deltas: JSONArray = JSONArray(), val fullFiles: Boolean = false)
val checks = mutableStateMapOf<String, Check>()
private val workers = Executors.newFixedThreadPool(2)
private val checkedAt = java.util.concurrent.ConcurrentHashMap<String, Long>()
private val inFlight = java.util.concurrent.ConcurrentHashMap.newKeySet<String>()
@Volatile private var account = ""
private val revision = java.util.concurrent.atomic.AtomicLong()
private const val HELPER = "/usr/local/bin/droiddeck-gog-maintenance"
const val OPERATION = "gogOperation"
const val FOLDER = "gogFolder"
fun reset() {
revision.incrementAndGet()
account = ""; checkedAt.clear()
StoresState.post { checks.clear() }
}
fun checkInstalled(context: Context, games: List<InstalledStoreGame>) {
val user = StoreAccounts.displayName(context, Store.GOG).orEmpty()
if (user != account) { reset(); account = user }
if (user.isBlank()) return
games.filter { it.sidecar.store == Store.GOG && it.sidecar.isInstalled }.forEach { check(context, it) }
}
fun check(context: Context, game: InstalledStoreGame, force: Boolean = false) {
val key = game.folder.absolutePath
if (!force && System.currentTimeMillis() - (checkedAt[key] ?: 0) < 30 * 60_000) return
if (!inFlight.add(key)) return
val owner = revision.get()
StoresState.post { checks[game.sidecar.id] = Check(State.CHECKING) }
workers.execute {
val result = runCatching {
var old = GogInstallRecord.migrate(game.folder, game.sidecar)
if (!old.verified || GogFiles.journal(game.folder).exists()) Check(State.UNKNOWN, reason = "Finish or recover the GOG maintenance operation first")
else {
val token = GogContent.token(context)
if (old.source == "depot") {
val builds = GogContent.builds(old.id, token)
if (old.files.length() == 0 && old.build.isNotBlank()) GogBuild.select(builds, pinned = old.build)?.let { old = old.copy(branch = it.branch, generation = it.generation) }
val latest = GogBuild.select(builds, branch = old.branch)
when { latest == null -> Check(State.UNKNOWN, reason = "No build is available on the installed branch")
old.build.isBlank() -> Check(State.UNKNOWN, latest.version, "The installed build is unknown")
latest.id == old.build -> Check(State.CURRENT, old.version)
else -> Check(State.AVAILABLE, latest.version) }
} else {
val downloads = GogContent.product(old.id, token).getJSONObject("downloads")
val installer = offlineInstaller(downloads, old.language)
if (old.version.isBlank()) Check(State.UNKNOWN, installer.version, "The installed version is unknown")
else Check(if (old.version == installer.version) State.CURRENT else State.AVAILABLE, installer.version)
}
}
}.getOrElse { Check(State.FAILED, reason = it.message ?: "GOG update check failed") }
if (revision.get() == owner && (result.state == State.CURRENT || result.state == State.AVAILABLE)) checkedAt[key] = System.currentTimeMillis()
inFlight.remove(key)
StoresState.post { if (revision.get() == owner) checks[game.sidecar.id] = result }
}
}
fun offlinePatches(context: Context, game: InstalledStoreGame): List<GogOfflineDownload> =
GogOfflineDownload.parse(GogContent.product(game.sidecar.id, GogContent.token(context)).getJSONObject("downloads"), "patches")
internal fun offlineInstaller(downloads: JSONObject, language: String): GogOfflineDownload {
val installers = GogOfflineDownload.parse(downloads, "installers")
return installers.firstOrNull { it.language.equals(language, true) }
?: installers.firstOrNull { !it.language.equals("Neutral", true) && StoreLanguage.depotAccepted(arrayOf(it.language), language) }
?: installers.firstOrNull { it.language.equals("Neutral", true) }
?: error("No Windows offline installer is available for the installed language ($language)")
}
fun prepare(context: Context, game: InstalledStoreGame, operation: GogOperation, patch: GogOfflineDownload? = null, resume: Boolean = false): Proposal {
val folder = game.folder.canonicalFile
var old = GogInstallRecord.migrate(folder, game.sidecar)
val journal = GogFiles.read(GogFiles.journal(folder))
require(journal == null || journal.optString("folder") == folder.path) { "GOG recovery folder does not match" }
if (journal != null && journal.optString("phase") in setOf("patch-starting", "patch-applying", "patch-uncertain") && operation != GogOperation.REFRESH) error("The patch was interrupted. Inspect the installer result or use a full offline refresh; it will not be rerun automatically.")
require(journal == null || operation == GogOperation.REFRESH || journal.optString("operation") == operation.name) { "Resume the existing GOG operation or select a full offline refresh" }
val token = GogContent.token(context)
if (operation == GogOperation.PATCH) {
if (old.source == "depot" && old.manifest.length() == 0 && old.build.isNotBlank()) {
val exact = GogBuild.select(GogContent.builds(old.id, token), pinned = old.build)
?: error("The installed GOG setup manifest is unavailable; use a full offline refresh")
old = GogContent.snapshot(old, exact, token)
}
check(patch != null) { "Select a GOG patch" }
if (resume) require(journal?.optString("downloadVersion") == patch.version) { "The selected patch changed; select it again in Offline patches" }
val selected = GogContent.resolveDownload(patch, token)
return Proposal(folder, old, old.copy(source = "offline", version = selected.version, verified = false), operation, selected.size,
selected.size + folder.walkTopDown().onEnter { !java.nio.file.Files.isSymbolicLink(it.toPath()) && it.name != ".droiddeck-gog" }.filter { it.isFile }.sumOf { it.length() }, selected)
}
if (operation == GogOperation.REFRESH || old.source != "depot") {
require(operation != GogOperation.REPAIR) { "This offline installation has no depot manifest. Use a full offline refresh to restore its files." }
val download = GogContent.resolveDownload(offlineInstaller(GogContent.product(old.id, token).getJSONObject("downloads"), old.language), token)
if (resume) require(journal?.optString("downloadId") == download.id && journal.optString("downloadVersion") == download.version) { "The previous offline installer is no longer available; select a new full offline refresh" }
if (old.products.any { it != old.id }) {
val pinned = journal?.optJSONObject("target")?.optString("build").orEmpty()
val build = GogBuild.select(GogContent.builds(old.id, token), pinned = pinned, branch = old.branch)
?: error("No depot build is available to preserve installed DLC during this refresh. Use Update instead.")
val target = GogContent.snapshot(old, build, token)
GogFiles.validate(target.files, folder)
val native = GogNative.isAvailable()
val remaining = GogEstimate.calculate(folder, old, target, JSONArray(), reuseChunks = native)
return Proposal(folder, old, target, GogOperation.REFRESH, Math.addExact(download.size, remaining.download),
Math.addExact(Math.multiplyExact(download.size, 3), remaining.required), download, fullFiles = !native)
}
val target = old.copy(source = "offline", build = "", generation = 0, version = download.version, manifest = JSONObject(), files = JSONArray(), verified = true)
return Proposal(folder, old, target, GogOperation.REFRESH, download.size, download.size * 3, download)
}
require(old.verified || operation != GogOperation.REPAIR) { "The patched installation must be reconciled before repair" }
val pinned = journal?.optJSONObject("target")?.let(GogInstallRecord::parse)
val builds = GogContent.builds(old.id, token)
if (old.files.length() == 0 && old.build.isNotBlank()) GogBuild.select(builds, pinned = old.build)?.let { old = old.copy(branch = it.branch, generation = it.generation) }
val build = GogBuild.select(builds,
pinned = pinned?.build ?: if (operation == GogOperation.REPAIR) old.build.ifBlank { error("The installed GOG build is unknown; update it first") } else "",
branch = pinned?.branch ?: old.branch) ?: error("The requested GOG build is no longer available")
val target = GogContent.snapshot(old, build, token)
GogFiles.validate(target.files, folder)
var before = journal?.optJSONObject("before")?.let(GogInstallRecord::parse) ?: old
if (before.files.length() == 0 && before.build.isNotBlank()) {
val historical = GogBuild.select(builds, pinned = before.build)
if (historical != null) before = runCatching { GogContent.snapshot(before, historical, token) }.getOrDefault(before)
}
val deltas = GogContent.patches(before, target, token)
val native = GogNative.isAvailable()
val size = GogEstimate.calculate(folder, before, target, deltas, reuseChunks = native)
return Proposal(folder, before, target, operation, size.download, size.required, deltas = deltas, fullFiles = !native)
}
fun resume(context: Context, game: InstalledStoreGame): Proposal {
val journal = GogFiles.read(GogFiles.journal(game.folder)) ?: error("GOG operation journal is missing")
val operation = GogOperation.valueOf(journal.getString("operation"))
val patch = if (operation == GogOperation.PATCH) offlinePatches(context, game)
.firstOrNull { it.id == journal.optString("downloadId") } ?: error("The selected GOG patch is no longer available") else null
return prepare(context, game, operation, patch, resume = true)
}
fun recoverPatch(context: Context, game: InstalledStoreGame) {
val folder = game.folder.canonicalFile
check(!DownloadQueue.isActive(game.key)) { "Wait for the GOG operation to finish" }
val journal = GogFiles.read(GogFiles.journal(folder)) ?: error("GOG patch journal is missing")
require(journal.optString("folder") == folder.path && journal.optString("operation") == GogOperation.PATCH.name)
require(journal.optString("phase") in setOf("patch-starting", "patch-applying", "patch-uncertain"))
RandomAccessFile(GogFiles.inside(folder, ".droiddeck-gog/lease"), "rw").use { lease ->
val lock = runCatching { lease.channel.tryLock() }.getOrNull() ?: error("Close the patch installer before verifying its result")
lock.use {
ensureIdle(context, folder)
val before = GogInstallRecord.parse(journal.getJSONObject("before"))
val buildId = GogInstallRecord.authenticBuild(folder, before.id).ifBlank { before.build }
check(buildId.isNotBlank()) { "The resulting build is unknown. Use a full offline refresh." }
val token = GogContent.token(context)
val build = GogBuild.select(GogContent.builds(before.id, token), pinned = buildId)
?: error("The resulting build manifest is unavailable. Use a full offline refresh.")
val target = GogContent.snapshot(before, build, token)
GogFiles.validate(target.files, folder)
check(target.files.objects().all { it.optBoolean("directory") || GogFiles.matches(folder, it) }) {
"The files do not match the reported build. Use a full offline refresh to recover."
}
val sidecar = StoreGameSidecar.parse(journal.getJSONObject("sidecar").toString()) ?: error("The original GOG settings are missing")
target.write(folder)
StoreInstalls.complete(context, folder, sidecar.copy(installVersion = target.build, state = StoreGameSidecar.STATE_INSTALLED))
check(GogFiles.journal(folder).delete()) { "Could not finish the GOG recovery record" }
}
}
checkedAt.remove(folder.path)
DownloadQueue.dismiss(game.key)
StoresState.notifyLibraryChanged(context)
StoresState.post { checks.remove(game.sidecar.id) }
}
fun enqueue(context: Context, game: InstalledStoreGame, proposal: Proposal) {
val app = context.applicationContext
require(game.folder.canonicalFile == proposal.folder)
check(!DownloadQueue.isActive("gog:${game.sidecar.id}")) { "GOG maintenance is already queued" }
check(!StoreInstallRoot.insufficientSpace(proposal.diskBytes, StoreInstallRoot.availableBytes(proposal.folder))) { "Not enough free space for GOG maintenance" }
val journal = JSONObject().put("schema", 1).put("folder", proposal.folder.path).put("operation", proposal.operation.name)
.put("before", proposal.before.json()).put("target", proposal.target.json()).put("sidecar", game.sidecar.toJson()).put("phase", "download")
proposal.patch?.let { journal.put("downloadId", it.id).put("downloadVersion", it.version) }
GogFiles.write(GogFiles.journal(proposal.folder), journal)
val item = CatalogItem(Store.GOG, game.sidecar.id, game.sidecar.title, game.sidecar.hero, tallImageUrl = game.sidecar.cover,
extra = mapOf(OPERATION to proposal.operation.name, FOLDER to proposal.folder.path))
SavedQueue.remember(app, item, null)
enqueueJob(app, item, proposal)
}
private fun enqueueJob(context: Context, item: CatalogItem, proposal: Proposal) {
DownloadQueue.enqueue(context, DownloadEntry(Store.GOG, item.id, item.title, cover = item.tallImageUrl,
bytesTotal = proposal.downloadBytes, location = StoreInstallRoot.labelFor(context, proposal.folder))) { Job(context, proposal) }
}
fun restore(context: Context, item: CatalogItem) {
val folder = File(item.extra[FOLDER] ?: error("Missing GOG recovery folder")).canonicalFile
require(StoreInstallRoot.gameFolders(context).any { it.canonicalFile == folder }) { "GOG recovery folder is unavailable" }
val sidecar = StoreGameSidecar.read(folder) ?: error("GOG installation record is missing")
require(sidecar.store == Store.GOG && sidecar.id == item.id)
val journal = GogFiles.read(GogFiles.journal(folder)) ?: error("GOG operation journal is missing")
val operation = GogOperation.valueOf(journal.getString("operation"))
if (journal.optString("phase") in setOf("patch-starting", "patch-applying", "patch-uncertain")) {
DownloadQueue.recordFailed(context, DownloadEntry(Store.GOG, item.id, item.title), "The patch result needs recovery; open Offline patches")
return
}
val game = InstalledStoreGame(sidecar, folder)
SavedQueue.remember(context, item, null)
enqueueJob(context, item, resume(context, game))
}
private class Job(val app: Context, val proposal: Proposal) : DownloadQueue.DownloadJob {
val cancelled = AtomicBoolean(false)
@Volatile var applyingPatch = false
@Volatile private var running = false
@Volatile private var deleteCaches = false
override fun cancel(deleteFiles: Boolean) {
if (applyingPatch) return
deleteCaches = deleteCaches || deleteFiles
cancelled.set(true)
if (!running && deleteCaches) cleanCaches()
}
override fun run(handle: DownloadQueue.JobHandle): String? {
running = true
try { return perform(handle) }
finally {
running = false; applyingPatch = false; handle.interruptible(true)
if (deleteCaches) cleanCaches()
}
}
private fun cleanCaches() {
for (name in listOf("stage", "downloads", "extracted")) {
val root = GogFiles.inside(proposal.folder, ".droiddeck-gog/$name")
if (root.exists()) java.nio.file.Files.walk(root.toPath()).use { paths ->
paths.sorted(java.util.Comparator.reverseOrder()).forEach { java.nio.file.Files.deleteIfExists(it) }
}
}
}
private fun perform(handle: DownloadQueue.JobHandle): String? {
val folder = proposal.folder
val journal = GogFiles.read(GogFiles.journal(folder)) ?: error("GOG operation journal is missing")
val sidecar = StoreGameSidecar.parse(journal.getJSONObject("sidecar").toString()) ?: error("GOG previous installation is missing")
if (proposal.operation == GogOperation.PATCH) {
val result = GogOffline.apply(app, proposal, handle, cancelled, onApplying = { applyingPatch = true; handle.interruptible(false) })
applyingPatch = false; handle.interruptible(true)
if (!result || cancelled.get()) return null
} else {
RandomAccessFile(GogFiles.inside(folder, ".droiddeck-gog/lease"), "rw").use { lease ->
val lock = runCatching { lease.channel.tryLock() }.getOrNull() ?: error("Close the GOG game before updating it")
lock.use {
ensureIdle(app, folder)
sidecar.copy(state = StoreGameSidecar.STATE_UPDATING).write(folder)
GogFiles.write(GogFiles.journal(folder), journal.put("phase", "applying"))
if (proposal.operation == GogOperation.REFRESH) {
GogOffline.refresh(app, proposal, handle, cancelled)
if (!cancelled.get() && proposal.target.source == "depot") transfer(app, proposal, handle, cancelled)
} else transfer(app, proposal, handle, cancelled)
if (cancelled.get()) return null
}
}
}
if (cancelled.get()) return null
val target = GogInstallRecord.read(folder)?.takeIf { proposal.operation == GogOperation.PATCH || proposal.operation == GogOperation.REFRESH && proposal.target.source != "depot" } ?: proposal.target
check(target.verified) { "The patch completed, but its resulting version could not be verified. Inspect the game or use a full offline refresh." }
target.write(folder)
StoreInstalls.complete(app, folder, sidecar.copy(installVersion = target.build.ifBlank { target.version }, state = StoreGameSidecar.STATE_INSTALLED))
check(GogFiles.journal(folder).delete()) { "Could not finish the GOG recovery record" }
runCatching { cleanCaches() }.onFailure { handle.log("gog: completed; could not remove expendable cache: ${it.message}") }
checkedAt.remove(folder.path)
StoresState.post { checks.remove(sidecar.id) }
return folder.path
}
}
private fun ensureIdle(context: Context, folder: File) {
val game = AddedGames.single(context, folder.path) ?: return
check(SessionState.gameId != (game.appId and 0xffffffffL).toString()) { "Close the GOG game before maintenance" }
if (SessionState.running) {
val id = (game.steamAppId?.toLong() ?: game.appId) and 0xffffffffL
val guest = AddedGames.guestPath(context, folder) ?: error("The GOG folder is unavailable to Linux")
if (SessionState.suspended || AgentGuest.hello(context) == null) {
val root = AddedGames.guestPath(context, SessionPrefs.activeSteamRoot(context)) ?: error("The Steam folder is unavailable to Linux")
val rc = GuestCommand.run(context, listOf("/usr/bin/env", "STEAM_COMPAT_CLIENT_INSTALL_PATH=$root", HELPER, "idle", guest, id.toString(), game.guestExe),
extraBinds = StoreInstallRoot.externalBindSpecs(context), logName = "gog-idle", onLine = StoresState::logLine)
check(rc == 0) { "Close the GOG game before maintenance" }
return
}
val request = JSONObject().put("kind", "exec").put("argv", JSONArray(listOf(HELPER, "idle", guest, id.toString(), game.guestExe))).put("timeout", 15)
val result = AgentGuest.call(context, request, 20_000, trusted = true)
check(result.optBoolean("ok") && result.optInt("exitCode", -1) == 0) { "Close the GOG game before maintenance" }
}
}
private fun transfer(context: Context, proposal: Proposal, handle: DownloadQueue.JobHandle?, stop: AtomicBoolean, callback: GogDownloadManager.Callback? = null) {
val token = GogContent.token(context)
var patches = proposal.deltas
var previousWire = 0L
for (attempt in 0..4) {
if (stop.get()) return
val links = GogContent.links(proposal.target, GogContent.token(context))
val patchLinks = if (patches.length() > 0) runCatching { GogContent.links(proposal.target, token, patches = true) }.getOrElse { patches = JSONArray(); JSONObject() } else JSONObject()
val plan = JSONObject().put("files", proposal.target.files).put("oldFiles", proposal.before.files)
.put("patches", patches).put("links", links).put("patchLinks", patchLinks).put("downloadBytes", proposal.downloadBytes)
val optimized = GogNative.isAvailable()
val remaining = GogEstimate.calculate(proposal.folder, proposal.before, proposal.target, patches, reuseChunks = optimized).required
check(!StoreInstallRoot.insufficientSpace(remaining, StoreInstallRoot.availableBytes(proposal.folder))) { "Not enough free space for remaining GOG maintenance" }
handle?.diskSize(remaining)
if (!optimized) {
try { GogFallback.transfer(proposal.folder, plan, handle, stop, callback); return }
catch (e: Exception) {
if (stop.get()) return
if (attempt == 4 || Regex("HTTP (401|403|404|500)").find(e.message.orEmpty()) == null) throw e
handle?.log("gog: refreshing file-download links; verified replacements are retained")
continue
}
}
val latch = CountDownLatch(1)
var runWire = 0L
var success = false; var expired = false; var failure = "GOG download failed"
val listener = object : GogNative.Listener {
override fun onProgress(bytesDone: Long, bytesTotal: Long, filesDone: Int, filesTotal: Int, file: String, fileBytes: Long, verified: Boolean) {
handle?.stage(if (verified) DownloadStage.VERIFY else DownloadStage.INSTALL)
handle?.stageProgress(filesDone.toLong(), filesTotal.toLong(), filesDone, filesTotal)
callback?.onStage(if (verified) "verify" else "install", filesDone.toLong(), filesTotal.toLong(), filesDone, filesTotal)
}
override fun onBytes(bytesDone: Long, bytesTotal: Long) {
runWire = bytesDone
handle?.progress(previousWire + bytesDone, (previousWire + bytesTotal).coerceAtLeast(previousWire + bytesDone))
callback?.onBytes(previousWire + bytesDone, (previousWire + bytesTotal).coerceAtLeast(previousWire + bytesDone), 0)
}
override fun onLog(line: String) { handle?.log(line); callback?.onLog(line) }
override fun onMaintenance(networkBytes: Long, reusedBytes: Long, appliedBytes: Long) { handle?.maintenance(reusedBytes, appliedBytes) }
override fun onComplete(ok: Boolean, cancelled: Boolean, linkExpiry: Boolean, error: String, bytesWritten: Long, filesDone: Int) {
success = ok; expired = linkExpiry; failure = error; latch.countDown()
}
}
val native = GogNative.start(2, arrayOf(plan.toString()), emptyArray(), proposal.folder.path, emptyArray(), "", 1, 1, false, "gog maintenance", listener)
check(native != 0L) { "GOG native engine could not start" }
try { while (!latch.await(200, TimeUnit.MILLISECONDS)) if (stop.get()) GogNative.cancel(native) }
finally { GogNative.release(native) }
if (stop.get()) return
if (success) {
for (file in proposal.target.files.objects()) if (!file.optBoolean("directory") && file.optString("md5").isBlank() && file.optString("sha256").isBlank())
file.put("sha256", GogFiles.hash(GogFiles.inside(proposal.folder, file.getString("path")), "SHA-256"))
return
}
if (!expired || attempt == 4) error(failure)
previousWire += runWire
handle?.log("gog: refreshing expired download links; validated files and chunks are retained")
}
}
@JvmStatic
fun installContent(context: Context, game: GogGame, folder: File, builds: JSONObject, language: String,
callback: GogDownloadManager.Callback, cancelled: AtomicBoolean): GogDownloadManager.Result? {
val build = GogBuild.select(builds) ?: return null
folder.mkdirs()
val old = GogInstallRecord(game.gameId, "depot", language = language)
val target = GogContent.snapshot(old, build, GogContent.token(context))
GogFiles.validate(target.files, folder)
val bytes = target.files.objects().sumOf { it.optJSONArray("chunks")?.objects()?.sumOf { c -> c.optLong("compressedSize") }?.takeIf { n -> n > 0 } ?: it.optLong("size") }
val disk = target.files.objects().sumOf { it.optLong("size") }
check(!StoreInstallRoot.insufficientSpace(disk, StoreInstallRoot.availableBytes(folder))) { "Not enough free space for GOG installation" }
callback.onSizes(bytes, disk)
transfer(context, Proposal(folder, old, target, GogOperation.UPDATE, bytes, disk), null, cancelled, callback)
if (cancelled.get()) return null
target.write(folder)
val result = GogDownloadManager.Result(GogDownloadManager.pickExe(folder, null, game.title), build.id, disk)
result.language = target.language
result.dependencies = target.manifest.optJSONArray("dependencies")?.strings().orEmpty()
result.dependenciesRead = true
return result
}
@JvmStatic
fun captureDepot(id: String, folder: File, build: String, buildsJson: String, manifest: JSONObject, depots: JSONArray, language: String) {
val selected = GogBuild.select(JSONObject(buildsJson), pinned = build)
val files = JSONArray()
for (depot in depots.strings()) for (item in JSONObject(depot).getJSONObject("depot").getJSONArray("items").objects()) {
val chunks = item.optJSONArray("chunks") ?: continue
files.put(JSONObject().put("path", item.getString("path").replace('\\', '/')).put("size", chunks.objects().sumOf { it.optLong("size") })
.put("md5", item.optString("md5")).put("chunks", chunks).put("product", id))
}
GogFiles.validate(files, folder)
GogInstallRecord(id, "depot", 2, build, selected?.version.orEmpty(), selected?.branch.orEmpty(), language,
manifest = GogContent.sanitize(manifest), files = files).write(folder)
}
@JvmStatic
fun captureOffline(id: String, folder: File, downloads: JSONObject) {
val selected = GogOfflineDownload.parse(downloads, "installers").firstOrNull() ?: return
GogInstallRecord(id, "offline", version = selected.version, language = selected.language).write(folder)
}
}
@@ -15,6 +15,8 @@ object GogNative {
fun onBytes(bytesDone: Long, bytesTotal: Long)
fun onMaintenance(networkBytes: Long, reusedBytes: Long, appliedBytes: Long)
fun onLog(line: String)
fun onComplete(success: Boolean, cancelled: Boolean, linkExpiry: Boolean, error: String, bytesWritten: Long, filesDone: Int)
@@ -26,7 +28,7 @@ object GogNative {
fun isAvailable(): Boolean {
available?.let { return it }
val ok = try {
StoresNative.ensureLoaded() && nativeProbe() == 1
StoresNative.ensureLoaded() && nativeProbe() == 2
} catch (t: Throwable) {
Log.w(TAG, "native GOG engine unavailable: ${t.javaClass.simpleName}: ${t.message}")
false
@@ -0,0 +1,200 @@
package com.droiddeck.launcher.stores.gog
import android.content.Context
import com.droiddeck.launcher.agent.AgentGuest
import com.droiddeck.launcher.frontend.AddedGames
import com.droiddeck.launcher.runtime.GuestCommand
import com.droiddeck.launcher.session.SessionService
import com.droiddeck.launcher.session.SessionState
import com.droiddeck.launcher.stores.StoreGameSidecar
import com.droiddeck.launcher.stores.StoreInstallRoot
import com.droiddeck.launcher.stores.download.DownloadQueue
import com.droiddeck.launcher.stores.download.DownloadStage
import org.json.JSONArray
import org.json.JSONObject
import java.io.File
import java.util.concurrent.atomic.AtomicBoolean
internal object GogOffline {
private const val HELPER = "/usr/local/bin/droiddeck-gog-maintenance"
internal data class Layout(val source: File, val prefix: String)
internal fun layout(extracted: File, installed: File, id: String, executable: String): Layout {
val nested = executable.startsWith("app/", true) && !File(installed, "goggame-$id.info").isFile
return Layout(extracted, if (nested) "app/" else "")
}
internal fun validateDepotInstaller(extracted: File, target: GogInstallRecord) {
if (target.source != "depot") return
val builds = listOf(extracted, File(extracted, "app")).map { GogInstallRecord.authenticBuild(it, target.id) }.filter { it.isNotBlank() }
require(builds.isNotEmpty() && builds.all { it == target.build } && target.build.isNotBlank()) {
"The offline installer does not identify the selected depot build. Use Update to preserve installed DLC."
}
}
private fun download(context: Context, proposal: GogMaintenance.Proposal, handle: DownloadQueue.JobHandle, stop: AtomicBoolean): File {
val patch = proposal.patch ?: error("GOG download selection is missing")
val root = File(GogFiles.dir(proposal.folder), "downloads").apply { mkdirs() }
var first: File? = null; var bytes = 0L
for ((index, part) in patch.parts.withIndex()) {
if (stop.get()) return first ?: File(root, "cancelled")
val resolved = GogDownloadManager.resolveRedirect(part.url, GogContent.token(context)) ?: error("The GOG download link is unavailable")
val serverName = GogContent.downloadFilename(resolved).takeIf { it.endsWith(".exe", true) || it.endsWith(".bin", true) }
val name = part.name.ifBlank { serverName ?: error("GOG did not provide the installer part filename") }
require('/' !in name && '\\' !in name && name !in setOf(".", "..")) { "Invalid GOG installer filename" }
val file = GogFiles.inside(root, name)
val receipt = File(root, "part-$index.json")
val saved = GogFiles.read(receipt)
val complete = file.isFile && (part.size <= 0 || file.length() == part.size) && when {
part.md5.isNotBlank() -> GogFiles.hash(file).equals(part.md5, true)
saved?.optString("id") == part.id && saved.optString("filename") == name -> GogFiles.hash(file, "SHA-256") == saved.optString("sha256")
else -> false
}
if (!complete) {
val staging = GogFiles.inside(root, "$name.partial")
GogFallback.download(listOf(resolved), staging, part.size, stop, { n -> bytes += n; handle.progress(bytes, proposal.downloadBytes.coerceAtLeast(bytes)) })
if (stop.get()) return first ?: file
if (part.md5.isNotBlank()) check(GogFiles.hash(staging).equals(part.md5, true)) { "GOG installer checksum mismatch" }
GogFiles.replace(staging, file)
GogFiles.write(receipt, JSONObject().put("id", part.id).put("filename", name).put("sha256", GogFiles.hash(file, "SHA-256")))
}
if (index == 0) { check(file.extension.equals("exe", true)) { "GOG patch has no setup executable" }; first = file }
}
return first ?: error("GOG download has no files")
}
fun refresh(context: Context, proposal: GogMaintenance.Proposal, handle: DownloadQueue.JobHandle, stop: AtomicBoolean) {
val installer = download(context, proposal, handle, stop)
if (stop.get()) return
val extracted = File(GogFiles.dir(proposal.folder), "extracted").apply { mkdirs() }
val source = AddedGames.guestPath(context, installer) ?: error("The GOG installer is not visible to Linux")
val target = AddedGames.guestPath(context, extracted) ?: error("The GOG staging folder is not visible to Linux")
handle.stage(DownloadStage.INSTALL, "Extracting the full offline installer")
val rc = GuestCommand.run(context, listOf("/usr/local/bin/droiddeck-innoextract", "--gog", "--silent", "-d", target, source),
extraBinds = StoreInstallRoot.externalBindSpecs(context), cancelled = stop, logName = "gog-refresh", onLine = handle::log)
if (stop.get()) return
check(rc == 0) { "GOG installer extraction failed (exit $rc)" }
applyRefresh(proposal, extracted, handle, stop)
}
internal fun applyRefresh(proposal: GogMaintenance.Proposal, extracted: File, handle: DownloadQueue.JobHandle?, stop: AtomicBoolean) {
validateDepotInstaller(extracted, proposal.target)
val sidecar = StoreGameSidecar.read(proposal.folder) ?: error("The original GOG settings are missing")
val layout = layout(extracted, proposal.folder, proposal.before.id, sidecar.exe)
val files = layout.source.walkTopDown().onEnter { directory ->
check(!java.nio.file.Files.isSymbolicLink(directory.toPath())) { "GOG installer contains a symbolic link" }
directory.parentFile != extracted || directory.name !in setOf("tmp", "commonappdata", "userappdata", "localappdata")
}.filter { it != layout.source && it != File(extracted, "app") }.map { file ->
check(!java.nio.file.Files.isSymbolicLink(file.toPath()))
val relative = file.relativeTo(layout.source).invariantSeparatorsPath.removePrefix("app/")
JSONObject().put("path", layout.prefix + relative)
.put("size", if (file.isDirectory) 0 else file.length()).put("directory", file.isDirectory)
.put("md5", if (file.isDirectory) "" else GogFiles.hash(file)).put("product", proposal.before.id) to file
}.toList().groupBy { it.first.getString("path") }.map { (_, entries) ->
check(entries.size == 1 || entries.all { it.first.getBoolean("directory") }) { "GOG installer has conflicting file locations" }
entries.first()
}
check(files.any { !it.first.getBoolean("directory") }) { "GOG installer contained no game files" }
val inventory = JSONArray(files.map { it.first })
GogFiles.validate(inventory, proposal.folder)
val executable = sidecar.exe.replace('\\', '/')
check(files.any { !it.first.getBoolean("directory") && it.first.getString("path").equals(executable, true) } ||
proposal.before.verified && proposal.before.files.length() > 0 &&
proposal.before.files.objects().none { it.getString("path").equals(executable, true) } && GogFiles.inside(proposal.folder, executable).isFile) {
"The offline installer did not extract the game's executable. No installed files were changed."
}
val installed = proposal.target.copy(files = inventory)
GogFiles.write(File(GogFiles.dir(proposal.folder), "refresh-target.json"), installed.json())
for ((index, entry) in files.withIndex()) {
if (stop.get()) return
val (file, sourceFile) = entry
val destination = GogFiles.inside(proposal.folder, file.getString("path"))
if (file.getBoolean("directory")) java.nio.file.Files.createDirectories(destination.toPath()) else {
destination.parentFile!!.mkdirs()
GogFiles.replace(sourceFile, destination)
}
handle?.stageProgress((index + 1).toLong(), files.size.toLong())
}
if (proposal.target.source != "depot") {
val targetPaths = files.mapTo(HashSet()) { it.first.getString("path").lowercase(java.util.Locale.ROOT) }
for (old in proposal.before.files.objects()) if (old.getString("path").lowercase(java.util.Locale.ROOT) !in targetPaths && GogFiles.matches(proposal.folder, old))
check(GogFiles.inside(proposal.folder, old.getString("path")).delete())
installed.write(proposal.folder)
}
}
fun apply(context: Context, proposal: GogMaintenance.Proposal, handle: DownloadQueue.JobHandle, stop: AtomicBoolean, onApplying: () -> Unit): Boolean {
check(GogFiles.read(GogFiles.journal(proposal.folder))?.optString("phase") in setOf("download", "patch-ready")) {
"The patch result needs recovery. Inspect the installer or use a full offline refresh; the patch will not be run again."
}
val installer = download(context, proposal, handle, stop)
if (stop.get()) return false
val setup = GogContent.setupFiles(proposal.before, GogContent.token(context))
if (setup != null) {
GogFallback.transfer(proposal.folder, JSONObject().put("files", setup.first).put("links", setup.second)
.put("downloadBytes", setup.first.objects().sumOf { it.getJSONArray("chunks").objects().sumOf { chunk -> chunk.getLong("compressedSize") } }), handle, stop)
if (stop.get()) return false
}
val added = AddedGames.single(context, proposal.folder.path) ?: error("The GOG game shortcut is unavailable")
val id = (added.steamAppId?.toLong() ?: added.appId) and 0xffffffffL
val folder = AddedGames.guestPath(context, proposal.folder) ?: error("The GOG folder is unavailable to Linux")
val executable = AddedGames.guestPath(context, installer) ?: error("The GOG patch is unavailable to Linux")
context.startActivity(android.content.Intent(context, com.droiddeck.launcher.SessionActivity::class.java)
.putExtra(SessionService.EXTRA_MODE, if (SessionState.running) SessionState.mode else SessionService.MODE_DESKTOP)
.addFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK or android.content.Intent.FLAG_ACTIVITY_CLEAR_TOP or android.content.Intent.FLAG_ACTIVITY_SINGLE_TOP))
val deadline = System.currentTimeMillis() + 120_000
while (AgentGuest.hello(context) == null && System.currentTimeMillis() < deadline) { if (stop.get()) return false; Thread.sleep(250) }
check(AgentGuest.hello(context) != null) { "The Linux session did not become ready; open it and retry" }
val journal = GogFiles.read(GogFiles.journal(proposal.folder)) ?: error("GOG patch journal is missing")
journal.put("phase", "patch-ready")
File(GogFiles.dir(proposal.folder), "patch-status.json").delete()
GogFiles.write(GogFiles.journal(proposal.folder), journal)
val request = JSONObject().put("kind", "exec").put("timeout", 15)
.put("env", JSONObject().put("DROIDDECK_GOG_DESKTOP", if (SessionState.mode == SessionService.MODE_DESKTOP) "1" else "0"))
.put("argv", JSONArray(listOf(HELPER, "start", folder, id.toString(), executable, added.guestExe)))
if (stop.get()) return false
onApplying()
val response = AgentGuest.call(context, request, 20_000, trusted = true)
check(response.optBoolean("ok") && response.optInt("exitCode", -1) == 0) { "The GOG patch installer could not start; inspect the GOG log" }
handle.stage(DownloadStage.INSTALL, "Use the Linux session to finish or cancel the patch installer")
var nextStatus = System.currentTimeMillis() + 5_000
while (true) {
val status = GogFiles.read(File(GogFiles.dir(proposal.folder), "patch-status.json"))
if (status?.optString("state") in setOf("done", "failed", "uncertain")) {
check(status?.optString("state") == "done") { status?.optString("reason") ?: "GOG patch failed" }
break
}
check(SessionState.running) { "The patch session ended. Its result needs recovery; the patch will not be rerun automatically." }
check(!SessionState.suspended) { "The patch session was suspended. Resume it and verify recovery before retrying." }
if (System.currentTimeMillis() >= nextStatus) {
val query = JSONObject().put("kind", "exec").put("timeout", 5).put("argv", JSONArray(listOf(HELPER, "status", folder)))
val answer = AgentGuest.call(context, query, 10_000, trusted = true)
check(answer.optBoolean("ok") && answer.optInt("exitCode", -1) == 0) { "The patch helper could not be reached. Resume the Linux session and verify recovery." }
nextStatus = System.currentTimeMillis() + 5_000
}
Thread.sleep(500)
}
val info = GogFiles.read(File(proposal.folder, "goggame-${proposal.before.id}.info"))
val version = info?.optString("versionName").orEmpty()
val build = GogInstallRecord.authenticBuild(proposal.folder, proposal.before.id)
var record = proposal.target.copy(build = build, version = version, files = JSONArray(), manifest = JSONObject(), verified = false)
record.write(proposal.folder)
if (build.isNotBlank()) {
record = runCatching {
val token = GogContent.token(context)
val target = GogBuild.select(GogContent.builds(record.id, token), pinned = build)
val snapshot = target?.let { GogContent.snapshot(record, it, token) }
snapshot?.takeIf { it.files.objects().all { f -> f.optBoolean("directory") || GogFiles.matches(proposal.folder, f) } } ?: record
}.getOrDefault(record)
}
record.write(proposal.folder)
if (!record.verified) {
val before = StoreGameSidecar.read(proposal.folder) ?: error("The GOG installation record is missing")
before.copy(installVersion = "", state = StoreGameSidecar.STATE_UPDATING).write(proposal.folder)
val operation = GogFiles.read(GogFiles.journal(proposal.folder))!!
GogFiles.write(GogFiles.journal(proposal.folder), operation.put("phase", "patch-uncertain"))
}
return true
}
}
@@ -33,6 +33,9 @@ import androidx.compose.ui.layout.positionInRoot
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.Constraints
import androidx.compose.ui.layout.layout
import kotlinx.coroutines.delay
import androidx.compose.runtime.setValue
import androidx.compose.runtime.getValue
@@ -40,6 +43,20 @@ import androidx.compose.runtime.getValue
/** A grid of cards with a game page that floods out of the opened card and drains back into it. */
internal val LocalDetailFloor = compositionLocalOf<() -> Float> { { Float.MAX_VALUE } }
/** How far the host reaches past the page's padding, so a game page can paint to the screen edge and still inset its content. */
internal class DetailInset(val horizontal: Dp, val top: Dp)
internal val LocalDetailInset = compositionLocalOf { DetailInset(0.dp, 0.dp) }
private fun Modifier.bleed(horizontal: Dp, top: Dp): Modifier =
if (horizontal == 0.dp && top == 0.dp) this else layout { measurable, constraints ->
val h = horizontal.roundToPx()
val t = top.roundToPx()
val placeable = measurable.measure(
Constraints.fixed(constraints.maxWidth + h * 2, if (constraints.hasBoundedHeight) constraints.maxHeight + t else constraints.minHeight),
)
layout(constraints.maxWidth, placeable.height - t) { placeable.place(-h, -t) }
}
@OptIn(androidx.compose.ui.ExperimentalComposeUiApi::class)
@Composable
internal fun CardDetailHost(
@@ -48,6 +65,8 @@ internal fun CardDetailHost(
gridScrolled: () -> Boolean,
onDetailFocus: (Boolean) -> Unit,
modifier: Modifier = Modifier,
bleedHorizontal: Dp = 0.dp,
bleedTop: Dp = 0.dp,
wrap: @Composable (key: String, content: @Composable () -> Unit) -> Unit = { _, content -> content() },
grid: @Composable () -> Unit,
detail: @Composable (key: String) -> Unit,
@@ -86,7 +105,7 @@ internal fun CardDetailHost(
val gridAlpha by animateFloatAsState(if (covering) 0f else 1f, if (covering) Motion.tw(320, 80) else Motion.tw(300, 100), label = "gridFade")
val fade = with(density) { 14.dp.toPx() }
Box(
modifier.clipToBounds()
modifier.bleed(bleedHorizontal, bleedTop).clipToBounds()
.onGloballyPositioned { viewportAt = it.positionInRoot(); viewportH = it.size.height }
.graphicsLayer { compositingStrategy = androidx.compose.ui.graphics.CompositingStrategy.Offscreen }
.drawWithContent {
@@ -100,7 +119,7 @@ internal fun CardDetailHost(
) {
CompositionLocalProvider(LocalFrontFocus provides if (covering) null else ff) {
Column(
modifier = Modifier.fillMaxSize()
modifier = Modifier.fillMaxSize().padding(horizontal = bleedHorizontal).padding(top = bleedTop)
.graphicsLayer { scaleX = gridScale; scaleY = gridScale; alpha = gridAlpha }
.focusProperties { enter = { if (coveringNow.value) FocusRequester.Cancel else FocusRequester.Default } }
.focusGroup(),
@@ -111,7 +130,7 @@ internal fun CardDetailHost(
val body: @Composable () -> Unit = {
Column(
Modifier.fillMaxSize().pointerInput(Unit) { detectTapGestures { } }
.verticalScroll(detailScroll).padding(top = 4.dp, bottom = 16.dp),
.verticalScroll(detailScroll).padding(bottom = 16.dp),
) {
Column(
Modifier.fillMaxWidth()
@@ -120,7 +139,7 @@ internal fun CardDetailHost(
.focusGroup(),
) {
val floor = { viewportAt.y + viewportH - with(density) { 16.dp.toPx() } - detailScroll.value }
CompositionLocalProvider(LocalDetailFloor provides floor) { detail(key) }
CompositionLocalProvider(LocalDetailFloor provides floor, LocalDetailInset provides DetailInset(bleedHorizontal, bleedTop + 4.dp)) { detail(key) }
}
}
}
@@ -94,7 +94,12 @@ internal class FocusGlide(view: View?) {
internal val LocalFocusGlide = staticCompositionLocalOf<FocusGlide?> { null }
internal object RingVeil {
var count by mutableIntStateOf(0)
private var state = mutableIntStateOf(0)
var count: Int
get() = state.intValue
set(value) { state.intValue = value }
internal fun reset() { state = mutableIntStateOf(0) }
}
@Composable
@@ -258,7 +258,7 @@ class FrontEndActions(
val onCopyPhantomCommand: (Boolean) -> Unit = {},
val onDismissPhantomGate: () -> Unit = {},
val onStartWirelessAdbPairing: () -> Unit = {},
val onStartPairingGuide: (Int?) -> Boolean = { false },
val onStartPairingGuide: (Int?, Boolean) -> Boolean = { _, _ -> false },
val onShowPhantomGate: () -> Unit = {},
val onOpenNotificationSettings: () -> Unit = {},
val controller: ControllerActions? = null,
@@ -431,6 +431,7 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
var showWirelessAdbFix by rememberSaveable { mutableStateOf(false) }
var showDeveloperDisplayChoice by rememberSaveable { mutableStateOf(false) }
var developerChoiceGuided by rememberSaveable { mutableStateOf(false) }
var developerChoiceToggle by rememberSaveable { mutableStateOf(false) }
var wirelessAdbDesiredEnabled by rememberSaveable { mutableStateOf(false) }
var appToChooseDisplay by remember { mutableStateOf<HomeApp.LaunchableApp?>(null) }
val colors = MaterialTheme.colorScheme
@@ -440,13 +441,26 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
val processSettingsPageVisible = phantomGateVisible || showWirelessAdbFix || showDeveloperDisplayChoice
val requestDeveloperOptions = {
developerChoiceGuided = false
developerChoiceToggle = false
if (s.secondScreenDisplays.isEmpty()) a.onOpenDeveloperOptions(null)
else showDeveloperDisplayChoice = true
}
val openDeveloperOptionsOn: (Int?) -> Unit = { displayId ->
if (developerChoiceGuided) a.onStartWirelessAdbPairing()
if (!developerChoiceGuided || !a.onStartPairingGuide(displayId)) a.onOpenDeveloperOptions(displayId)
val guided = developerChoiceGuided || developerChoiceToggle
if (!guided || !a.onStartPairingGuide(displayId, developerChoiceToggle)) a.onOpenDeveloperOptions(displayId)
developerChoiceGuided = false
developerChoiceToggle = false
}
val requestChildProcessToggle = {
if (!PhantomProcessLimit.hasDeveloperToggle() || com.droiddeck.launcher.core.GlobalSettings.developerOptionsOn(ctx)) {
requestDeveloperOptions()
} else {
developerChoiceGuided = false
developerChoiceToggle = true
if (s.secondScreenDisplays.isEmpty()) openDeveloperOptionsOn(null)
else showDeveloperDisplayChoice = true
}
}
val startGuidedPairing = {
if (!com.droiddeck.launcher.core.WirelessAdbPairingService.notificationsEnabled(ctx)) {
@@ -627,7 +641,7 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
if (s.secondScreenDisplays.isEmpty()) a.onAndroidApp(app, null)
else appToChooseDisplay = app
},
onOpenDeveloperOptions = requestDeveloperOptions,
onOpenDeveloperOptions = requestChildProcessToggle,
onRequestWirelessAdb = requestWirelessAdbFix,
onPairWirelessDebugging = startGuidedPairing,
)
@@ -662,7 +676,7 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
PhantomProcessGatePage(
status = s.phantomProcessStatus,
onDismiss = a.onDismissPhantomGate,
onOpenDeveloperOptions = requestDeveloperOptions,
onOpenDeveloperOptions = requestChildProcessToggle,
applyingSavedPairing = applyingSavedPairing,
onFixWithWirelessDebugging = fixPhantomLimit,
onEnterAddressManually = { requestWirelessAdbFix(false) },
@@ -699,6 +713,7 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
onDismiss = {
showDeveloperDisplayChoice = false
developerChoiceGuided = false
developerChoiceToggle = false
},
)
}
@@ -841,9 +841,8 @@ private fun SettingCard(label: String, value: String, id: String, modifier: Modi
verticalArrangement = Arrangement.spacedBy(3.dp),
modifier = modifier.paneItem(id)
.graphicsLayer { scaleX = scale; scaleY = scale }
.clip(Shape14)
.background(if (hot) pal.signal.copy(alpha = 0.10f) else colors.surface)
.glideBorder(hot, Shape14, pal.signal, pal.line2)
.then(if (LocalGlass.current != null) Modifier.glass(Shape14, if (hot) 0.04f else 0f) else Modifier.clip(Shape14).background(if (hot) pal.signal.copy(alpha = 0.10f) else colors.surface))
.glideBorder(hot, Shape14, pal.signal, if (LocalGlass.current != null) Color.Transparent else pal.line2)
.hoverable(src).clickable(interactionSource = src, indication = LocalIndication.current, role = Role.Button, onClick = onClick)
.controllerConfirm(onClick = onClick)
.padding(horizontal = 14.dp, vertical = 12.dp),
@@ -32,6 +32,7 @@ import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Settings
@@ -163,6 +164,8 @@ internal fun PrimaryButton(
) {
val colors = MaterialTheme.colorScheme
val pal = LocalPalette.current
val pillMode = LocalPillButtons.current
val btnShape = if (pillMode) CircleShape else Shape12
val frontFocus = if (main) LocalFrontFocus.current else null
if (frontFocus != null) DisposableEffect(Unit) {
frontFocus.primaryAttached++
@@ -180,22 +183,22 @@ internal fun PrimaryButton(
horizontalArrangement = if (fill) Arrangement.spacedBy(8.dp, Alignment.CenterHorizontally) else Arrangement.spacedBy(8.dp),
modifier = modifier.then(track)
.onGloballyPositioned { placed[0] = it }
.heightIn(min = if (compact) 44.dp else 48.dp)
.heightIn(min = if (pillMode) 40.dp else if (compact) 44.dp else 48.dp)
.then(if (frontFocus != null) Modifier.focusRequester(frontFocus.primary).onFocusChanged { if (it.isFocused) frontFocus.last = FrontFocus.PRIMARY } else Modifier)
.graphicsLayer { alpha = if (LaunchOrigin.flooding === placed) 0f else 1f; scaleX = scale; scaleY = scale; shadowElevation = if (enabled) lift.dp.toPx() else 0f; shape = Shape12; clip = false; ambientShadowColor = pal.signal; spotShadowColor = pal.signal }
.clip(Shape12)
.graphicsLayer { alpha = if (LaunchOrigin.flooding === placed) 0f else 1f; scaleX = scale; scaleY = scale; shadowElevation = if (enabled) lift.dp.toPx() else 0f; shape = btnShape; clip = false; ambientShadowColor = pal.signal; spotShadowColor = pal.signal }
.clip(btnShape)
.background(if (enabled) Brush.linearGradient(listOf(colors.primary, pal.primary2)) else Brush.linearGradient(listOf(colors.surfaceVariant, colors.surfaceVariant)))
.then(if (enabled) Modifier else Modifier.border(1.dp, pal.line2, Shape12))
.glideBorder(hot, Shape12, pal.signal, hotFillAlpha = 0f)
.then(if (enabled) Modifier else Modifier.border(1.dp, pal.line2, btnShape))
.glideBorder(hot, btnShape, pal.signal, hotFillAlpha = 0f)
.hoverable(src).clickable(role = Role.Button, interactionSource = src, indication = null, enabled = enabled) {
placed[0]?.takeIf { it.isAttached }?.let { LaunchOrigin.mark(it.boundsInRoot(), placed) }
onClick()
}
.padding(
start = if (fill) 12.dp else if (large) 20.dp else if (compact) 10.dp else if (icon != null) 14.dp else 18.dp,
end = if (fill) 12.dp else if (large) 26.dp else if (compact) 10.dp else 18.dp,
top = if (large) 16.dp else if (compact) 7.dp else 11.dp,
bottom = if (large) 16.dp else if (compact) 7.dp else 11.dp,
start = if (fill) 12.dp else if (large) 20.dp else if (pillMode) 18.dp else if (compact) 10.dp else if (icon != null) 14.dp else 18.dp,
end = if (fill) 12.dp else if (large) 26.dp else if (pillMode) 20.dp else if (compact) 10.dp else 18.dp,
top = if (large) 16.dp else if (pillMode) 8.dp else if (compact) 7.dp else 11.dp,
bottom = if (large) 16.dp else if (pillMode) 8.dp else if (compact) 7.dp else 11.dp,
),
) {
val fg = if (enabled) colors.onPrimary else colors.onSurfaceVariant
@@ -240,22 +243,24 @@ internal fun ProgressLabel(label: @Composable (Modifier) -> Unit, progress: Floa
@Composable
internal fun SecondaryButton(text: String, enabled: Boolean = true, compact: Boolean = false, modifier: Modifier = Modifier, progress: Float? = null, onClick: () -> Unit) {
val colors = MaterialTheme.colorScheme
val pill = LocalPillButtons.current
val shape = if (pill) CircleShape else Shape12
val src = remember { MutableInteractionSource() }
val hot = rememberHot(src) && enabled
val pressed by src.collectIsPressedAsState()
val scale by animateFloatAsState(if (pressed) 0.955f else if (hot) 1.02f else 1f, Motion.sp(0.5f, Spring.StiffnessMedium), label = "secScale")
val pal = LocalPalette.current
val fill by animateColorAsState(if (hot) pal.signal.copy(alpha = 0.14f) else Color.White.copy(alpha = 0.03f), Motion.tw(250), label = "secFill")
val fill by animateColorAsState(if (hot) pal.signal.copy(alpha = 0.14f) else Color.White.copy(alpha = if (pill) 0.09f else 0.03f), Motion.tw(250), label = "secFill")
Box(
contentAlignment = Alignment.Center,
modifier = modifier.paneItem("btn:$text").downToFirstTile().heightIn(min = if (compact) 44.dp else 48.dp).graphicsLayer { scaleX = scale; scaleY = scale }.clip(Shape12).background(fill).glideBorder(hot, Shape12, pal.signal, pal.line2)
modifier = modifier.paneItem("btn:$text").downToFirstTile().heightIn(min = if (pill) 40.dp else if (compact) 44.dp else 48.dp).graphicsLayer { scaleX = scale; scaleY = scale }.clip(shape).background(fill).glideBorder(hot, shape, pal.signal, if (pill) Color.White.copy(alpha = 0.14f) else pal.line2)
.alpha(if (enabled) 1f else 0.5f)
.hoverable(src).clickable(role = androidx.compose.ui.semantics.Role.Button, interactionSource = src, indication = LocalIndication.current, enabled = enabled, onClick = onClick)
.controllerConfirm(enabled = enabled, onClick = onClick)
.padding(horizontal = if (compact) 10.dp else 16.dp, vertical = if (compact) 7.dp else 11.dp),
.padding(horizontal = if (pill) 16.dp else if (compact) 10.dp else 16.dp, vertical = if (pill) 8.dp else if (compact) 7.dp else 11.dp),
) {
ProgressLabel({ m -> Text(text, fontSize = if (compact) 12.sp else 15.sp, fontWeight = FontWeight.SemiBold, letterSpacing = 0.5.sp, color = colors.onBackground, maxLines = 1, modifier = m) },
progress, fontSize = if (compact) 12.sp else 15.sp)
ProgressLabel({ m -> Text(text, fontSize = if (compact || pill) 13.sp else 15.sp, fontWeight = FontWeight.SemiBold, letterSpacing = 0.5.sp, color = colors.onBackground, maxLines = 1, modifier = m) },
progress, fontSize = if (compact || pill) 13.sp else 15.sp)
}
}
@@ -0,0 +1,133 @@
package com.droiddeck.launcher.ui
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import com.droiddeck.launcher.R
import com.droiddeck.launcher.hud.FusionSize
/** Bannerlator's Fusion HUD settings (DeckOverlaySettings): one row per key of the HUD's config string. */
@Composable
internal fun FusionHudSettings(host: MenuHost, a: DrawerActions, track: (String) -> Modifier) {
val cfg = a.hudConfig
fun on(key: String) = cfg[key] == "1"
fun int(key: String, fallback: Int) = cfg[key]?.toIntOrNull() ?: fallback
SettingsGroup(stringResource(R.string.drawer_hud), detail = stringResource(R.string.hud_matches_steam_overlay)) {
ToggleRow(host, "hud", stringResource(R.string.drawer_hud), null, a.hudOn, chipModifier = track("hud"), onChange = a.onHud)
if (!a.hudOn) return@SettingsGroup
val size = FusionSize.from(cfg["hudSize"])
ChoiceRow(host, "hud-size", stringResource(R.string.hud_size), stringResource(R.string.hud_size_hint),
listOf(
FusionSize.FULL to stringResource(R.string.hud_size_full),
FusionSize.TILES to stringResource(R.string.hud_size_tiles),
FusionSize.PILL to stringResource(R.string.hud_size_pill),
FusionSize.MINIMAL to stringResource(R.string.hud_size_minimal),
FusionSize.MEGA to stringResource(R.string.hud_size_mega),
),
size, chipModifier = track("hud-size")) { a.onHudSetting("hudSize", it.token) }
ToggleRow(host, "hud-locked", stringResource(R.string.hud_locked), stringResource(R.string.hud_locked_hint), on("hudLocked"),
chipModifier = track("hud-locked")) { a.onHudSetting("hudLocked", flag(it)) }
}
if (!a.hudOn) return
SettingsGroup(stringResource(R.string.hud_group_look)) {
SliderRow(stringResource(R.string.hud_scale), null, int("hudScale", 100), 50..150, step = 5, format = { "$it%" },
modifier = track("hud-scale")) { a.onHudSetting("hudScale", it.toString()) }
SliderRow(stringResource(R.string.drawer_hud_opacity), null, int("hudOpacity", 80), 0..100, step = 5, format = { "$it%" },
modifier = track("hud-opacity")) { a.onHudSetting("hudOpacity", it.toString()) }
ChoiceRow(host, "hud-color", stringResource(R.string.drawer_hud_color), null,
listOf("soft" to stringResource(R.string.hud_color_soft), "mid" to stringResource(R.string.hud_color_mid),
"vivid" to stringResource(R.string.hud_color_vivid)),
cfg["hudColor"] ?: "mid", chipModifier = track("hud-color")) { a.onHudSetting("hudColor", it) }
SliderRow(stringResource(R.string.hud_outline), null, int("hudOutline", 40), 0..100, step = 10,
modifier = track("hud-outline")) { a.onHudSetting("hudOutline", it.toString()) }
ChoiceRow(host, "hud-outline-color", stringResource(R.string.hud_outline_color), null,
listOf("0" to stringResource(R.string.hud_outline_gray), "1" to stringResource(R.string.hud_outline_theme)),
if (cfg["hudOutlineAccent"] == "0") "0" else "1", chipModifier = track("hud-outline-color")) { a.onHudSetting("hudOutlineAccent", it) }
}
val size = FusionSize.from(cfg["hudSize"])
val chips = size.supportedChips() + EXTRA[size].orEmpty()
SettingsGroup(stringResource(R.string.hud_group_metrics)) {
for (metric in METRICS) {
if (metric.chip !in chips || metric.chip in HIDDEN[size].orEmpty()) continue
ToggleRow(host, "hud-${metric.key}", stringResource(metric.label), null, on(metric.key),
chipModifier = track("hud-${metric.key}")) { a.onHudSetting(metric.key, flag(it)) }
}
}
val tempsShown = ("Temp" in chips && on("showTemp")) || ("GPU temp" in chips && on("showGpuTemp"))
if (tempsShown) SettingsGroup(stringResource(R.string.hud_group_temps)) {
ChoiceRow(host, "hud-temp-unit", stringResource(R.string.hud_temp_unit), null,
listOf("c" to "°C", "f" to "°F"), if (cfg["tempUnit"].equals("f", true)) "f" else "c",
chipModifier = track("hud-temp-unit")) { a.onHudSetting("tempUnit", it) }
val bands = when {
cfg["tempBands"] == "0" -> "0"
cfg["tempAuto"] == "0" -> "2"
else -> "1"
}
ChoiceRow(host, "hud-temp-bands", stringResource(R.string.hud_temp_bands), stringResource(R.string.hud_temp_bands_hint),
listOf("0" to stringResource(R.string.hud_temp_bands_off), "1" to stringResource(R.string.hud_temp_bands_auto),
"2" to stringResource(R.string.hud_temp_bands_manual)),
bands, chipModifier = track("hud-temp-bands")) {
a.onHudSetting("tempBands", if (it == "0") "0" else "1")
a.onHudSetting("tempAuto", if (it == "2") "0" else "1")
}
if (bands == "2") {
SliderRow(stringResource(R.string.hud_temp_red_cpu), null, int("tempRedCpu", 90), 50..110, format = { "$it°C" },
modifier = track("hud-red-cpu")) { a.onHudSetting("tempRedCpu", it.toString()) }
SliderRow(stringResource(R.string.hud_temp_red_gpu), null, int("tempRedGpu", 90), 50..110, format = { "$it°C" },
modifier = track("hud-red-gpu")) { a.onHudSetting("tempRedGpu", it.toString()) }
SliderRow(stringResource(R.string.hud_temp_red_battery), null, int("tempRedBat", 48), 35..60, format = { "$it°C" },
modifier = track("hud-red-battery")) { a.onHudSetting("tempRedBat", it.toString()) }
}
}
SettingsGroup(stringResource(R.string.hud_group_more), detail = stringResource(R.string.hud_credit)) {
ActionRow(stringResource(R.string.hud_export), stringResource(R.string.hud_export_hint),
stringResource(R.string.hud_export_button), onClick = a.onHudExport, modifier = track("hud-export"))
ActionRow(stringResource(R.string.hud_reset), null, stringResource(R.string.hud_reset_button),
onClick = a.onHudReset, modifier = track("hud-reset"))
}
}
private fun flag(on: Boolean) = if (on) "1" else "0"
// The Pill also draws the battery temperature and watts.
private val EXTRA = mapOf(FusionSize.PILL to setOf("Temp", "Power"))
private class HudMetric(val chip: String, val key: String, val label: Int)
// FusionSize.supportedChips() names; Wrapper and DX version have nothing to show in DroidDeck.
private val METRICS = listOf(
HudMetric("FPS", "showFPS", R.string.drawer_hud_fps),
HudMetric("FPS graph", "showFPSGraph", R.string.hud_metric_graph),
HudMetric("FPS .1", "fpsDecimal", R.string.hud_metric_decimal),
HudMetric("0.01% low", "showLow001", R.string.hud_metric_low001),
HudMetric("Engine", "showEngine", R.string.hud_metric_engine),
HudMetric("GPU model", "showGpuModel", R.string.hud_metric_gpu_model),
HudMetric("GPU", "showGPULoad", R.string.hud_metric_gpu),
HudMetric("GPU temp", "showGpuTemp", R.string.hud_metric_gpu_temp),
HudMetric("CPU", "showCPUUsage", R.string.hud_metric_cpu),
HudMetric("Per-core", "showPerCore", R.string.hud_metric_per_core),
HudMetric("Temp", "showTemp", R.string.hud_metric_temp),
HudMetric("RAM", "showRAM", R.string.hud_metric_ram),
HudMetric("VRAM", "showVram", R.string.hud_metric_vram),
HudMetric("Swap", "showSwap", R.string.hud_metric_swap),
HudMetric("Battery", "showBattery", R.string.hud_metric_battery),
HudMetric("Power", "showPower", R.string.hud_metric_power),
HudMetric("Network", "showNet", R.string.hud_metric_network),
HudMetric("Resolution", "showResolution", R.string.hud_metric_resolution),
HudMetric("Proton", "showProton", R.string.hud_metric_proton),
HudMetric("Session", "showSession", R.string.hud_metric_session),
HudMetric("Clock", "showClock", R.string.hud_metric_clock),
)
// Switches a size lists but never draws (FusionHudView): the Pill and Minimal always show the FPS, the
// Pill has no graph, Tiles has no graph and no 0.01% low.
private val HIDDEN = mapOf(
FusionSize.PILL to setOf("FPS", "FPS graph"),
FusionSize.MINIMAL to setOf("FPS"),
FusionSize.TILES to setOf("FPS graph", "0.01% low"),
)
@@ -1,6 +1,15 @@
package com.droiddeck.launcher.ui
import androidx.compose.foundation.LocalIndication
import androidx.compose.ui.semantics.Role
import androidx.compose.runtime.CompositionLocalProvider
import com.droiddeck.launcher.stores.GameFacts
import androidx.compose.foundation.selection.selectable
import androidx.compose.foundation.layout.FlowRow
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.graphics.Shadow
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
@@ -29,6 +38,8 @@ import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.PlayArrow
import androidx.compose.material.icons.outlined.Delete
import androidx.compose.material.icons.outlined.Edit
import androidx.compose.material.icons.outlined.VideogameAsset
import androidx.compose.material.icons.filled.Check
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
@@ -170,7 +181,7 @@ internal fun GameDetail(
val scored = scores != null && (scores.metacritic != Lookup.None || scores.hltb != Lookup.None)
val prefix = game?.protonPrefix?.takeIf { it.isDirectory }
val tabs = buildList {
if (description.isNotBlank() || developer.isNotBlank() || publisher.isNotBlank() || releaseDate.isNotBlank() || (scored && stacked)) add(GameTab.ABOUT)
if (description.isNotBlank() || developer.isNotBlank() || publisher.isNotBlank() || releaseDate.isNotBlank() || scored || (!s.shortcutPicker && title.isNotBlank() && title != id)) add(GameTab.ABOUT)
if (achievementState != null) add(GameTab.ACHIEVEMENTS)
val cloud = game?.library == Library.XBOX_CLOUD
if (game != null && !cloud) add(GameTab.LAUNCH)
@@ -196,61 +207,64 @@ internal fun GameDetail(
val at = tabs.indexOf(tab).coerceAtLeast(0)
picked = tabs[(at + step + tabs.size) % tabs.size]
}
Column(Modifier.fillMaxWidth().onFocusChanged { inPage = it.hasFocus }.bumpers(onPrevious = { cycle(-1) }, onNext = { cycle(1) })) {
Rise(0) {
Box(Modifier.padding(bottom = 12.dp)) { BackLink(backLabel, compact = true, onClick = onBack) }
}
val hero: @Composable () -> Unit = {
DisposableEffect(Unit) { onDispose { StoresMotion.heroAt = null } }
GameHero(
title, item, installed, game,
Modifier.fillMaxWidth().heightIn(min = if (narrow) 170.dp else 210.dp).onGloballyPositioned { StoresMotion.heroAt = it.boundsInRoot() },
corner = {
if (!s.shortcutPicker) Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
if (installed != null && installed.sidecar.store == Store.ITCH) ItchCheckButton(installed)
RemoveButton(title, game, installed, a)
}
},
scores = scores.takeIf { !stacked },
) {
HeroEyebrow(source, game, item, installed, download?.location ?: failed?.location)
GameTitle(title, game?.logo ?: item?.logoUrl, if (narrow) 26.sp else 34.sp)
if (!failed?.error.isNullOrBlank()) Text(
failed!!.error!!, fontSize = 13.sp, lineHeight = 17.sp, fontWeight = FontWeight.Medium,
color = MaterialTheme.colorScheme.error, maxLines = 3, overflow = TextOverflow.Ellipsis,
)
Spacer(Modifier.height(4.dp))
GameActions(store, id, game, item, installed, s, a, Modifier.focusRequester(lead))
}
}
if (StoresMotion.heroLands) hero() else Rise(1) { hero() }
if (!s.shortcutPicker) Rise(2) {
GameResourcesRow(title.takeUnless { it == id }.orEmpty(), game, Modifier.padding(top = 6.dp))
}
if (tab != null) Rise(2) {
Column(Modifier.fillMaxWidth().padding(top = 14.dp), verticalArrangement = Arrangement.spacedBy(12.dp)) {
val labels = tabs.map { t ->
when (t) {
GameTab.ABOUT -> stringResource(R.string.game_tab_about)
GameTab.ACHIEVEMENTS -> achievementState?.list?.takeIf { it.isNotEmpty() }?.let { list ->
stringResource(R.string.game_tab_achievements_count, stringResource(R.string.achievements_title), achievementState.done, list.size)
} ?: stringResource(R.string.achievements_title)
GameTab.LAUNCH -> stringResource(R.string.game_tab_launch)
GameTab.SAVES -> stringResource(if (Store.byId(source).let { it == Store.GOG || it == Store.EPIC }) R.string.game_tab_saves_cloud else R.string.games_saves)
GameTab.INSTALL -> stringResource(R.string.game_tab_install)
val art: Any? = game?.hero ?: item?.imageUrl ?: installed?.sidecar?.hero ?: installed?.sidecar?.cover
val artModel: Any? = if (art is String) cardArtRequest(art, item?.tallImageUrl) else art
val inSteam = !s.shortcutPicker && source != Library.SOURCE_STEAM && (game != null || installed != null) && !(game?.library == Library.XBOX_CLOUD && installed == null)
val inset = LocalDetailInset.current
GameBackdrop(artModel, art ?: game?.art, hueOf(title), fadeTop = inset.top < 8.dp, onArtPlaced = { StoresMotion.heroAt = it }) {
Column(Modifier.fillMaxWidth().padding(horizontal = inset.horizontal).padding(top = inset.top).onFocusChanged { inPage = it.hasFocus }.bumpers(onPrevious = { cycle(-1) }, onNext = { cycle(1) })) {
Rise(0) {
Row(Modifier.fillMaxWidth().padding(bottom = 8.dp), verticalAlignment = Alignment.CenterVertically) {
Box(Modifier.glass(CircleShape)) { BackLink(backLabel, compact = true, onClick = onBack) }
Spacer(Modifier.weight(1f))
if (!s.shortcutPicker) CompositionLocalProvider(LocalPillButtons provides true) {
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
if (installed != null && installed.sidecar.store == Store.ITCH) ItchCheckButton(installed)
RemoveButton(title, game, installed, a)
}
}
}
TabStrip(
labels, tabs.indexOf(tab), { picked = tabs[it] }, Modifier.onFocusChanged { onStrip = it.hasFocus },
focusRequesters = tabs.map { tabFocus.getValue(it) }, bumpers = tabs.size > 1, compact = narrow,
)
Box(Modifier.fillMaxWidth().onFocusChanged { if (inPanel && !it.hasFocus) dropped++; inPanel = it.hasFocus }.testTag("game-tab-${tab.name.lowercase()}")) {
when (tab) {
GameTab.ABOUT -> AboutTab(developer, publisher, releaseDate, description, scores, stacked)
GameTab.ACHIEVEMENTS -> achievementState?.let { st -> AchievementsTab(StoreAchievements.forSource(store?.id)?.label.orEmpty(), st) }
GameTab.LAUNCH -> if (game != null) LaunchTab(game, s, a, hopRail)
GameTab.SAVES -> if (game != null && prefix != null) SavesTab(game, prefix, a)
GameTab.INSTALL -> InstallTab(game, installed, item, store)
}
val header: @Composable () -> Unit = {
Column(verticalArrangement = Arrangement.spacedBy(8.dp)) {
GameStatusLine(source, game, item, installed, download?.location ?: failed?.location, inSteam)
GameTitle(title, game?.logo ?: item?.logoUrl, if (narrow) 30.sp else 40.sp)
if (!failed?.error.isNullOrBlank()) Text(
failed!!.error!!, fontSize = 13.sp, lineHeight = 17.sp, fontWeight = FontWeight.Medium,
color = MaterialTheme.colorScheme.error, maxLines = 3, overflow = TextOverflow.Ellipsis,
)
Spacer(Modifier.height(2.dp))
GameCapsule(scores) { GameActions(store, id, game, item, installed, s, a, Modifier.focusRequester(lead), compactMenu = stacked) }
}
}
if (StoresMotion.heroLands) header() else Rise(1) { header() }
if (tab != null) Rise(2) {
Column(Modifier.fillMaxWidth().padding(top = 14.dp), verticalArrangement = Arrangement.spacedBy(10.dp)) {
val labels = tabs.map { t ->
when (t) {
GameTab.ABOUT -> stringResource(R.string.game_tab_about)
GameTab.ACHIEVEMENTS -> achievementState?.list?.takeIf { it.isNotEmpty() && !stacked }?.let { list ->
stringResource(R.string.game_tab_achievements_count, stringResource(R.string.achievements_title), achievementState.done, list.size)
} ?: stringResource(R.string.achievements_title)
GameTab.LAUNCH -> stringResource(R.string.game_tab_launch)
GameTab.SAVES -> stringResource(if (Store.byId(source).let { it == Store.GOG || it == Store.EPIC }) R.string.game_tab_saves_cloud else R.string.games_saves)
GameTab.INSTALL -> stringResource(R.string.game_tab_install)
}
}
GameTabBar(
labels, tabs.indexOf(tab), { picked = tabs[it] }, Modifier.onFocusChanged { onStrip = it.hasFocus },
focusRequesters = tabs.map { tabFocus.getValue(it) }, bumpers = tabs.size > 1, compact = stacked,
)
Box(Modifier.fillMaxWidth().onFocusChanged { if (inPanel && !it.hasFocus) dropped++; inPanel = it.hasFocus }.testTag("game-tab-${tab.name.lowercase()}")) {
when (tab) {
GameTab.ABOUT -> AboutTab(developer, publisher, releaseDate, description, scores, stacked) {
if (!s.shortcutPicker) GameResourcesRow(title.takeUnless { it == id }.orEmpty(), game)
}
GameTab.ACHIEVEMENTS -> achievementState?.let { st -> AchievementsTab(StoreAchievements.forSource(store?.id)?.label.orEmpty(), st) }
GameTab.LAUNCH -> if (game != null) LaunchTab(game, s, a, hopRail)
GameTab.SAVES -> if (game != null && prefix != null) SavesTab(game, prefix, a)
GameTab.INSTALL -> InstallTab(game, installed, item, store)
}
}
}
}
@@ -259,42 +273,21 @@ internal fun GameDetail(
}
@Composable
private fun GameHero(
title: String, item: CatalogItem?, installed: InstalledStoreGame?, game: Library.SteamGame?, modifier: Modifier,
corner: @Composable BoxScope.() -> Unit, scores: GameScores?, content: @Composable ColumnScope.() -> Unit,
) {
val colors = MaterialTheme.colorScheme
Box(modifier.clip(Shape16).background(artBrush(hueOf(title)))) {
val wide: Any? = game?.hero ?: item?.imageUrl ?: installed?.sidecar?.hero ?: installed?.sidecar?.cover
if (wide != null) {
// The card it came from keeps its own bitmap under the hero until the wide art is decoded.
val request = if (wide is String) cardArtRequest(wide, item?.tallImageUrl) else wide
AsyncImage(model = request, contentDescription = null, contentScale = ContentScale.Crop, modifier = Modifier.matchParentSize())
} else game?.art?.let { art ->
AsyncImage(
model = art, contentDescription = null, contentScale = ContentScale.Crop,
modifier = Modifier.matchParentSize().blur(24.dp).graphicsLayer { scaleX = 1.3f; scaleY = 1.3f },
)
}
Spacer(Modifier.matchParentSize().background(Brush.horizontalGradient(0f to colors.background.copy(alpha = 0.94f), 0.55f to colors.background.copy(alpha = 0.58f), 1f to Color.Transparent)))
var scoresWidth by remember { mutableStateOf(0) }
if (scores != null) {
Spacer(Modifier.matchParentSize().background(Brush.horizontalGradient(0.45f to Color.Transparent, 1f to colors.background.copy(alpha = 0.75f))))
HeroScores(scores, Modifier.align(Alignment.BottomEnd).padding(end = 16.dp, bottom = 18.dp).onSizeChanged { scoresWidth = it.width })
}
val scoresSpace = with(LocalDensity.current) { if (scores != null && scoresWidth > 0) scoresWidth.toDp() + 16.dp else 0.dp }
Column(
verticalArrangement = Arrangement.spacedBy(6.dp),
modifier = Modifier.align(Alignment.BottomStart).padding(start = 22.dp, end = 22.dp + scoresSpace, top = 18.dp, bottom = 18.dp),
content = content,
)
Box(Modifier.align(Alignment.TopEnd).padding(12.dp), content = corner)
private fun SourceBadge(source: String) {
val c = sourceColours(source)
Row(
verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(7.dp),
modifier = Modifier.glass(CircleShape, 0.06f).padding(horizontal = 10.dp, vertical = 4.dp),
) {
Box(Modifier.size(8.dp).clip(CircleShape).background(c.dot))
Text(sourceLabel(source), fontSize = 11.sp, fontWeight = FontWeight.Bold, letterSpacing = 0.8.sp, color = MaterialTheme.colorScheme.onBackground, maxLines = 1)
}
}
@Composable
private fun HeroEyebrow(source: String, game: Library.SteamGame?, item: CatalogItem?, installed: InstalledStoreGame?, downloadAt: String?) {
private fun GameStatusLine(source: String, game: Library.SteamGame?, item: CatalogItem?, installed: InstalledStoreGame?, downloadAt: String?, inSteam: Boolean) {
val ctx = LocalContext.current
val colors = MaterialTheme.colorScheme
val pal = LocalPalette.current
val folder = installed?.folder ?: game?.gameFiles
val passName = item?.includedWith.orEmpty()
@@ -310,10 +303,68 @@ private fun HeroEyebrow(source: String, game: Library.SteamGame?, item: CatalogI
else -> listOf(stringResource(R.string.stores_eyebrow_store))
}
val size = if (folder != null && (installed != null || game != null)) diskSize(installed, folder) else (item?.sizeBytes ?: 0L).takeIf { it > 0 }
val line = (state + listOfNotNull(size?.let { formatBytes(it) })).filter { it.isNotBlank() }.joinToString(" · ")
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp)) {
SourceChip(source)
Text(line.uppercase(), fontSize = 12.sp, fontWeight = FontWeight.SemiBold, letterSpacing = 1.2.sp, color = pal.signal, maxLines = 1, overflow = TextOverflow.Ellipsis)
val line = (state + listOfNotNull(size?.let { formatBytes(it) })).filter { it.isNotBlank() }.joinToString(" · ").replaceFirstChar { it.uppercase() }
val muted = colors.onBackground.copy(alpha = 0.78f)
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp)) {
SourceBadge(source)
Text(line, fontSize = 12.sp, color = muted, maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.weight(1f, fill = false))
if (inSteam) {
Text("·", fontSize = 12.sp, color = muted.copy(alpha = 0.5f))
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(5.dp)) {
Icon(Icons.Outlined.VideogameAsset, contentDescription = null, tint = muted, modifier = Modifier.size(15.dp))
Text(stringResource(R.string.stores_in_steam_label), fontSize = 12.sp, color = muted, maxLines = 1)
Icon(Icons.Filled.Check, contentDescription = null, tint = pal.good, modifier = Modifier.size(14.dp))
}
}
}
}
/** One frosted pill that holds the game's actions and its headline scores. */
@Composable
private fun GameCapsule(scores: GameScores?, actions: @Composable () -> Unit) {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier.fillMaxWidth().glass(RoundedCornerShape(30.dp)).padding(6.dp),
) {
CompositionLocalProvider(LocalPillButtons provides true) { Box(Modifier.weight(1f)) { actions() } }
if (scores != null) CapsuleScores(scores, Modifier.padding(start = 8.dp, end = 10.dp))
}
}
@Composable
private fun GameTabBar(
tabs: List<String>, selected: Int, onSelect: (Int) -> Unit,
modifier: Modifier = Modifier, focusRequesters: List<FocusRequester>? = null,
bumpers: Boolean = true, compact: Boolean = false,
) {
val colors = MaterialTheme.colorScheme
val pal = LocalPalette.current
Row(modifier.fillMaxWidth().glass(CircleShape).padding(4.dp), verticalAlignment = Alignment.CenterVertically) {
if (bumpers) BumperKey("LB", stringResource(R.string.widgets_prev_tab)) { onSelect((selected + tabs.size - 1) % tabs.size) }
tabs.forEachIndexed { i, label ->
val on = i == selected
val src = remember { MutableInteractionSource() }
val hot = rememberHot(src)
val pick = { onSelect(i) }
Box(
contentAlignment = Alignment.Center,
modifier = Modifier.weight(1f)
.testTag("tab-$i")
.then(focusRequesters?.getOrNull(i)?.let { Modifier.focusRequester(it) } ?: Modifier)
.clip(CircleShape)
.background(if (on) pal.signal.copy(alpha = 0.3f) else if (hot) pal.signal.copy(alpha = 0.14f) else Color.Transparent)
.glideBorder(hot, CircleShape, pal.signal, if (on) pal.signal.copy(alpha = 0.5f) else Color.Transparent)
.hoverable(src).selectable(selected = on, interactionSource = src, indication = null, role = Role.Tab, onClick = pick)
.controllerConfirm(onClick = pick)
.padding(horizontal = 6.dp, vertical = if (compact) 8.dp else 10.dp),
) {
Text(
label, fontSize = if (compact) 13.sp else 14.sp, fontWeight = if (on) FontWeight.Bold else FontWeight.SemiBold, maxLines = 1, overflow = TextOverflow.Ellipsis,
color = if (on || hot) colors.onBackground else colors.onSurfaceVariant,
)
}
}
if (bumpers) BumperKey("RB", stringResource(R.string.widgets_next_tab)) { onSelect((selected + 1) % tabs.size) }
}
}
@@ -323,17 +374,18 @@ private fun GameTitle(title: String, logo: Any?, titleSize: TextUnit) {
if (logo != null && !failed) AsyncImage(
model = logo, contentDescription = title, contentScale = ContentScale.Fit, alignment = Alignment.CenterStart,
onError = { failed = true },
modifier = Modifier.padding(vertical = 4.dp).height((titleSize.value * 2.2f).dp).widthIn(max = (titleSize.value * 9f).dp).testTag("game-logo"),
modifier = Modifier.padding(vertical = 4.dp).height((titleSize.value * 1.5f).dp).widthIn(max = (titleSize.value * 7f).dp).clip(RoundedCornerShape(10.dp)).testTag("game-logo"),
) else Text(
title, fontSize = titleSize, lineHeight = titleSize * 1.12f, fontWeight = FontWeight.Black,
color = MaterialTheme.colorScheme.onBackground, maxLines = 2, overflow = TextOverflow.Ellipsis,
style = TextStyle(shadow = Shadow(Color.Black.copy(alpha = 0.55f), blurRadius = 24f)),
)
}
@Composable
internal fun GameActions(
store: Store?, id: String?, game: Library.SteamGame?, item: CatalogItem?, installed: InstalledStoreGame?,
s: FrontEndState, a: FrontEndActions, leadOn: Modifier,
s: FrontEndState, a: FrontEndActions, leadOn: Modifier, compactMenu: Boolean = false,
) {
val ctx = LocalContext.current
val storeKey = if (store != null && id != null) "${store.id}:$id" else null
@@ -351,18 +403,20 @@ internal fun GameActions(
val gone = storeKey?.let { StoresState.uninstalling[it] }
val xboxBusy = store == Store.XBOX && id != null && XboxContent.busy(id)
PrimaryButton(
stringResource(R.string.stores_play), enabled = !s.busy && gone == null && download == null && !xboxBusy,
stringResource(R.string.stores_play), enabled = !s.busy && gone == null && download == null && !xboxBusy && (store != Store.GOG || installed?.sidecar?.isInstalled != false),
main = true, icon = Icons.Filled.PlayArrow, modifier = leadOn,
) {
if (game != null) a.onSteamGame(game) else if (store != null && id != null) launchStoreGame(ctx, store, id, s, a)
}
if ((game?.source ?: store?.id) != Library.SOURCE_STEAM) ActionChip(stringResource(R.string.stores_in_steam), ok = true)
if (game != null) {
FileButtons(game, a)
GameShortcutMenu(game, a)
EditArtButton(game)
if (compactMenu) GameMoreMenu(game, a) else {
FileButtons(game, a)
GameShortcutMenu(game, a)
EditArtButton(game)
}
}
if (store == Store.ITCH && installed != null) ItchUpdateButton(installed, download == null && StoresState.uninstalling[installed.key] == null)
if (store == Store.GOG && installed != null) GogMaintenanceActions(installed)
if (store == Store.XBOX && id != null) XboxInstalledStream(id, game?.name ?: item?.title.orEmpty(), item)
if (store == Store.XBOX && installed != null && id != null) {
SecondaryButton(stringResource(R.string.stores_xbox_update), enabled = download == null && !XboxRuntime.isActive(id)) {
@@ -520,10 +574,10 @@ private fun GameShortcutMenu(g: Library.SteamGame, a: FrontEndActions) {
/** The pencil opens the editor each kind of game always had: the shortcut editor for added games, art for the rest. */
@Composable
private fun EditArtButton(g: Library.SteamGame) {
private fun rememberEditArt(g: Library.SteamGame): (() -> Unit)? {
val ctx = LocalContext.current
val folder = g.gameFiles
val open: (() -> Unit)? = when {
return when {
g.library == Library.ADDED && g.source == Library.ADDED && folder != null -> {
{ GamesDialogState.editing = EditRequest(folder.path, openTarget = false, fromSummary = false, preview = EditPreview.of(ctx, g, folder.path)) }
}
@@ -531,21 +585,47 @@ private fun EditArtButton(g: Library.SteamGame) {
g.library == Library.ADDED && g.source != Library.ADDED && folder != null -> { { GamesDialogState.storeArt = g } }
else -> null
}
if (open != null) IconAction(Icons.Outlined.Edit, stringResource(R.string.common_edit), "game:edit", onClick = open)
}
@Composable
private fun EditArtButton(g: Library.SteamGame) {
val open = rememberEditArt(g) ?: return
IconAction(Icons.Outlined.Edit, stringResource(R.string.game_edit_art), "game:edit", onClick = open)
}
/** Narrow screens keep one More button in the capsule instead of a row of small ones. */
@Composable
private fun GameMoreMenu(g: Library.SteamGame, a: FrontEndActions) {
var open by remember(g.gameId) { mutableStateOf(false) }
val edit = rememberEditArt(g)
Box {
SecondaryButton(stringResource(R.string.game_more)) { open = !open }
AnchoredMenu(open, onDismiss = { open = false }, title = stringResource(R.string.game_more), compact = true) { first ->
var lead: FocusRequester? = first
fun take(): FocusRequester? = lead.also { lead = null }
g.gameFiles?.takeIf { it.isDirectory }?.let { dir -> MenuItem(stringResource(R.string.games_files), checked = false, focusRequester = take()) { open = false; a.onBrowseFiles(dir) } }
g.protonPrefix?.takeIf { it.isDirectory }?.let { dir -> MenuItem(stringResource(R.string.games_prefix), checked = false, focusRequester = take()) { open = false; a.onBrowseFiles(dir) } }
MenuItem(stringResource(R.string.game_shortcut_add), checked = false, focusRequester = take()) { open = false; a.onGameShortcut(g) }
MenuItem(stringResource(R.string.game_file_export), checked = false) { open = false; a.onExportGameFile(g) }
MenuItem(stringResource(R.string.game_link_copy), checked = false) { open = false; a.onCopyGameLink(g) }
edit?.let { run -> MenuItem(stringResource(R.string.game_edit_art), checked = false) { open = false; run() } }
}
}
}
@Composable
internal fun IconAction(icon: androidx.compose.ui.graphics.vector.ImageVector, label: String, id: String, danger: Boolean = false, enabled: Boolean = true, onClick: () -> Unit) {
val colors = MaterialTheme.colorScheme
val shape = if (LocalPillButtons.current) CircleShape else Shape12
val pal = LocalPalette.current
val src = remember { MutableInteractionSource() }
val hot = rememberHot(src) && enabled
val accent = if (danger) colors.error else pal.signal
Box(
contentAlignment = Alignment.Center,
modifier = Modifier.paneItem(id).downToFirstTile().size(44.dp).clip(Shape12)
modifier = Modifier.paneItem(id).downToFirstTile().size(if (LocalPillButtons.current) 40.dp else 44.dp).clip(shape)
.background(if (hot) accent.copy(alpha = if (danger) 0.22f else 0.14f) else if (danger) Color.Black.copy(alpha = 0.34f) else Color.White.copy(alpha = 0.03f))
.glideBorder(hot, Shape12, accent, pal.line2)
.glideBorder(hot, shape, accent, pal.line2)
.alpha(if (enabled) 1f else 0.45f)
.hoverable(src).clickable(interactionSource = src, indication = LocalIndication.current, role = androidx.compose.ui.semantics.Role.Button, enabled = enabled, onClick = onClick)
.controllerConfirm(enabled = enabled, onClick = onClick)
@@ -627,14 +707,10 @@ private fun InstallButton(label: String, modifier: Modifier = Modifier, onInstal
}
}
@OptIn(ExperimentalLayoutApi::class)
@Composable
private fun AboutTab(developer: String, publisher: String, releaseDate: String, description: String, scores: GameScores?, stacked: Boolean) {
Column(verticalArrangement = Arrangement.spacedBy(10.dp), modifier = Modifier.fillMaxWidth().tabPanel()) {
if (scores != null) Box(Modifier.readable()) { StoreGameFacts(developer, publisher, releaseDate, scores, scoresInHero = !stacked) }
else if (developer.isNotBlank() || publisher.isNotBlank() || releaseDate.isNotBlank()) {
val parts = listOf(developer, publisher, com.droiddeck.launcher.stores.GameFacts.releaseLabel(releaseDate).orEmpty()).filter { it.isNotBlank() }.distinct()
Text(parts.joinToString(" · "), fontSize = 13.sp, color = MaterialTheme.colorScheme.onSurfaceVariant, modifier = Modifier.readable())
}
private fun AboutTab(developer: String, publisher: String, releaseDate: String, description: String, scores: GameScores?, stacked: Boolean, resources: @Composable () -> Unit) {
val aboutText: @Composable () -> Unit = {
if (description.isNotBlank()) {
val floor = LocalDetailFloor.current
val density = LocalDensity.current
@@ -643,12 +719,35 @@ private fun AboutTab(developer: String, publisher: String, releaseDate: String,
StoreAbout(description, room, Modifier.fillMaxWidth().then(fill))
}
}
if (stacked) Column(verticalArrangement = Arrangement.spacedBy(12.dp), modifier = Modifier.fillMaxWidth().tabPanel()) {
val released = GameFacts.releaseLabel(releaseDate).orEmpty()
val credits = listOf(developer, publisher, released).filter { it.isNotBlank() }.distinct()
if (credits.isNotEmpty()) FlowRow(horizontalArrangement = Arrangement.spacedBy(8.dp), verticalArrangement = Arrangement.spacedBy(8.dp), modifier = Modifier.readable()) {
credits.forEachIndexed { i, part ->
Text(
part, fontSize = 13.sp, fontWeight = if (i == 0 && part == developer) FontWeight.SemiBold else FontWeight.Normal,
color = if (i == 0 && part == developer) MaterialTheme.colorScheme.onBackground else MaterialTheme.colorScheme.onSurfaceVariant, maxLines = 1,
modifier = Modifier.clip(CircleShape).background(Color.White.copy(alpha = 0.07f)).border(1.dp, Color.White.copy(alpha = 0.12f), CircleShape).padding(horizontal = 12.dp, vertical = 6.dp),
)
}
}
aboutText()
resources()
} else Row(horizontalArrangement = Arrangement.spacedBy(12.dp), verticalAlignment = Alignment.Top, modifier = Modifier.fillMaxWidth()) {
if (description.isNotBlank()) Column(Modifier.weight(1.3f).tabPanel()) { aboutText() }
Column((if (description.isNotBlank()) Modifier.weight(1f) else Modifier.fillMaxWidth()).tabPanel(), verticalArrangement = Arrangement.spacedBy(4.dp)) {
Text(headingUppercase(stringResource(R.string.store_details)), fontSize = 12.sp, fontWeight = FontWeight.SemiBold, letterSpacing = 1.5.sp, color = MaterialTheme.colorScheme.onSurfaceVariant, modifier = Modifier.padding(start = 8.dp, bottom = 4.dp))
if (scores != null) StoreDetailRows(developer, publisher, releaseDate, scores) else StoreDetailRows(developer, publisher, releaseDate, GameScores(Lookup.None, Lookup.None))
Box(Modifier.padding(top = 8.dp)) { resources() }
}
}
}
private val AboutHeight = 260.dp
@Composable
internal fun Modifier.tabPanel(): Modifier {
if (LocalGlass.current != null) return glass(RoundedCornerShape(22.dp), 0.22f).padding(horizontal = 18.dp, vertical = 14.dp)
val shape = RoundedCornerShape(16.dp)
return clip(shape).background(MaterialTheme.colorScheme.surface).border(1.dp, LocalPalette.current.line, shape).padding(horizontal = 16.dp, vertical = 14.dp)
}
@@ -680,7 +779,7 @@ private fun StoreAbout(text: String, height: Dp, modifier: Modifier = Modifier)
Text(text, fontSize = 14.sp, lineHeight = 21.sp, color = colors.onSurfaceVariant, modifier = Modifier.verticalScroll(scroll).padding(horizontal = 4.dp, vertical = 6.dp))
if (scroll.value < scroll.maxValue) Box(
Modifier.align(Alignment.BottomCenter).fillMaxWidth().height(28.dp)
.background(Brush.verticalGradient(listOf(Color.Transparent, colors.surface))),
.background(Brush.verticalGradient(listOf(Color.Transparent, if (LocalGlass.current != null) colors.background.copy(alpha = 0.72f) else colors.surface))),
)
}
}
@@ -834,12 +933,12 @@ internal fun Modifier.readable(): Modifier {
}
@Composable
private fun FactRow(label: String, value: String) {
internal fun FactRow(label: String, value: String, labelWidth: androidx.compose.ui.unit.Dp = 150.dp) {
Row(
horizontalArrangement = Arrangement.spacedBy(16.dp),
modifier = Modifier.fillMaxWidth().readable().padding(horizontal = 8.dp, vertical = 7.dp),
) {
Text(label, fontSize = 13.sp, color = MaterialTheme.colorScheme.onSurfaceVariant, modifier = Modifier.width(150.dp))
Text(label, fontSize = 13.sp, color = MaterialTheme.colorScheme.onSurfaceVariant, modifier = Modifier.width(labelWidth))
Text(value, fontSize = 13.sp, fontWeight = FontWeight.SemiBold, color = MaterialTheme.colorScheme.onBackground, modifier = Modifier.weight(1f), maxLines = 2, overflow = TextOverflow.Ellipsis)
}
}
@@ -0,0 +1,277 @@
package com.droiddeck.launcher.ui
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.compositionLocalOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.produceState
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.BiasAlignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.drawBehind
import androidx.compose.ui.draw.drawWithContent
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.geometry.isSpecified
import androidx.compose.ui.graphics.BlendMode
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.graphics.ColorMatrix
import androidx.compose.ui.graphics.CompositingStrategy
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.geometry.Rect
import androidx.compose.ui.graphics.Paint
import androidx.compose.ui.graphics.drawscope.drawIntoCanvas
import androidx.compose.ui.graphics.drawscope.DrawScope
import androidx.compose.ui.graphics.drawscope.clipRect
import androidx.compose.ui.graphics.drawscope.translate
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.graphics.luminance
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.layout.LayoutCoordinates
import androidx.compose.ui.layout.boundsInRoot
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.unit.dp
import coil.compose.AsyncImage
import coil.imageLoader
import coil.compose.rememberAsyncImagePainter
import coil.request.ImageRequest
import coil.size.Precision
import kotlin.math.max
/** Buttons in a capsule render as pills; elsewhere they keep their rounded-rectangle shape. */
internal val LocalPillButtons = compositionLocalOf { false }
/**
* The page's blurred art, shared so frosted surfaces can draw the part of it behind them.
* Coordinates are read when drawing, so a surface and the backdrop always agree on where they are.
*/
internal class GlassBackdrop {
var painter: Painter? = null
var coords: LayoutCoordinates? = null
var light: Boolean = false
var ready by mutableStateOf(false)
fun offsetOf(surface: LayoutCoordinates?): Offset? {
val base = coords?.takeIf { it.isAttached } ?: return null
val at = surface?.takeIf { it.isAttached } ?: return null
return base.localPositionOf(at, Offset.Zero)
}
fun paint(scope: DrawScope, size: Size) {
val art = painter ?: return
scope.drawCover(art, size, if (light) LightAmbient else DarkAmbient)
}
/** Drawn inside a layer, so it fades what was painted before it toward the page's end. */
fun fadeBottom(scope: DrawScope, size: Size) {
val fade = minOf(size.height * 0.5f, with(scope) { 240.dp.toPx() })
if (size.height <= 0f) return
scope.drawRect(Brush.verticalGradient((1f - fade / size.height) to Color.Black, 1f to Color.Transparent), size = size, blendMode = BlendMode.DstIn)
}
}
internal val LocalGlass = compositionLocalOf<GlassBackdrop?> { null }
private val DarkAmbient = ColorFilter.colorMatrix(
ColorMatrix().apply {
setToSaturation(1.3f)
timesAssign(ColorMatrix(floatArrayOf(0.55f, 0f, 0f, 0f, 0f, 0f, 0.55f, 0f, 0f, 0f, 0f, 0f, 0.55f, 0f, 0f, 0f, 0f, 0f, 1f, 0f)))
},
)
private val LightAmbient = ColorFilter.colorMatrix(ColorMatrix().apply { setToSaturation(1.1f) })
private fun DrawScope.drawCover(painter: Painter, into: Size, filter: ColorFilter) {
val intrinsic = painter.intrinsicSize
if (!intrinsic.isSpecified) return
val iw = intrinsic.width
val ih = intrinsic.height
if (iw <= 0f || ih <= 0f || into.width <= 0f || into.height <= 0f) return
val scale = max(into.width / iw, into.height / ih)
val w = iw * scale
val h = ih * scale
clipRect(0f, 0f, into.width, into.height) {
translate((into.width - w) * AmbientBiasX, (into.height - h) * AmbientBiasY) {
with(painter) { draw(Size(w, h), colorFilter = filter) }
}
}
}
private const val AmbientBiasX = 0.6f
private const val AmbientBiasY = 0.05f
private fun ambientRequest(ctx: android.content.Context, model: Any?): ImageRequest? =
model?.let { ImageRequest.Builder(ctx).data(it).size(AmbientPixels, AmbientPixels).precision(Precision.EXACT).memoryCacheKey("wash:$it").build() }
private const val AmbientPixels = 6
/** How washed-out the art is: average brightness less its saturation, from a tiny decode, so pale art is dimmed while dark and vivid art are left alone. */
@Composable
private fun rememberArtBrightness(model: Any?): Float {
val ctx = LocalContext.current
val data = (model as? ImageRequest)?.data ?: model
val brightness by produceState(0.3f, data) {
if (data == null) return@produceState
val request = ImageRequest.Builder(ctx).data(data).size(SamplePixels, SamplePixels).precision(Precision.EXACT)
.allowHardware(false).memoryCacheKey("lum:$data").build()
val bitmap = (ctx.imageLoader.execute(request).drawable as? android.graphics.drawable.BitmapDrawable)?.bitmap ?: return@produceState
var light = 0.0
var saturation = 0.0
for (y in 0 until bitmap.height) for (x in 0 until bitmap.width) {
val pixel = Color(bitmap.getPixel(x, y))
val top = maxOf(pixel.red, pixel.green, pixel.blue)
light += pixel.luminance()
if (top > 0f) saturation += (top - minOf(pixel.red, pixel.green, pixel.blue)) / top
}
val count = bitmap.width * bitmap.height
value = ((light - SaturationWeight * saturation) / count).toFloat().coerceAtLeast(0f)
}
return brightness
}
private const val SamplePixels = 8
private const val SaturationWeight = 0.6
/**
* A page whose game art fills the background: a blurred wash behind everything and the sharp art
* across the top, fading into the page. Surfaces inside draw frosted glass over the wash.
*/
@Composable
internal fun GameBackdrop(
art: Any?, ambient: Any?, fallbackHue: Float,
fadeTop: Boolean,
modifier: Modifier = Modifier,
onArtPlaced: (androidx.compose.ui.geometry.Rect?) -> Unit = {},
content: @Composable () -> Unit,
) {
val ctx = LocalContext.current
val colors = MaterialTheme.colorScheme
val glass = remember { GlassBackdrop() }
glass.light = colors.background.luminance() > 0.5f
val wash = rememberAsyncImagePainter(remember(ambient) { ambientRequest(ctx, ambient ?: art) })
glass.painter = if (ambient != null || art != null) wash else null
val edge = 24.dp
val artMin = with(LocalDensity.current) { ArtMin.toPx() }
Box(
modifier.fillMaxWidth().onGloballyPositioned {
glass.coords = it
if (!glass.ready) glass.ready = true
if (art == null) {
val at = it.boundsInRoot()
onArtPlaced(Rect(at.left, at.top, at.right, at.top + artMin))
}
},
) {
DisposableEffect(art == null) { onDispose { if (art == null) onArtPlaced(null) } }
Box(
Modifier.matchParentSize()
.graphicsLayer { compositingStrategy = CompositingStrategy.Offscreen }
.drawWithContent {
if (glass.painter == null) drawRect(artBrush(fallbackHue), alpha = 0.55f) else glass.paint(this, size)
drawRect(colors.background.copy(alpha = if (glass.light) 0.7f else 0.58f))
if (fadeTop) drawRect(Brush.verticalGradient(0f to Color.Transparent, (edge.toPx() / size.height).coerceAtMost(0.5f) to Color.Black), blendMode = BlendMode.DstIn)
glass.fadeBottom(this, size)
},
)
if (art != null) ArtLayer(art, ambient ?: art, fadeTop, onArtPlaced)
CompositionLocalProvider(LocalGlass provides glass) { content() }
}
}
@Composable
private fun ArtLayer(model: Any?, sample: Any?, fadeTop: Boolean, onPlaced: (androidx.compose.ui.geometry.Rect?) -> Unit) {
val colors = MaterialTheme.colorScheme
val light = colors.background.luminance() > 0.5f
val pale = ((rememberArtBrightness(sample) - 0.28f) / 0.5f).coerceIn(0f, 1f)
val dim = if (light) 1f else 1f - 0.4f * pale
val artFilter = remember(dim) { ColorFilter.colorMatrix(ColorMatrix(floatArrayOf(dim, 0f, 0f, 0f, 0f, 0f, dim, 0f, 0f, 0f, 0f, 0f, dim, 0f, 0f, 0f, 0f, 0f, 1f, 0f))) }
BoxWithConstraints(Modifier.fillMaxWidth()) {
val height = (maxWidth * 0.4f).coerceIn(ArtMin, ArtMax)
DisposableEffect(Unit) { onDispose { onPlaced(null) } }
Box(
Modifier.fillMaxWidth().height(height)
.onGloballyPositioned { onPlaced(it.boundsInRoot()) }
.graphicsLayer { compositingStrategy = CompositingStrategy.Offscreen }
.drawWithContent {
drawContent()
drawRect(Brush.horizontalGradient(0.08f to Color.Transparent, 0.55f to Color.Black), blendMode = BlendMode.DstIn)
drawRect(Brush.verticalGradient(0.55f to Color.Black, 1f to Color.Transparent), blendMode = BlendMode.DstIn)
if (fadeTop) drawRect(Brush.verticalGradient(0f to Color.Transparent, (24.dp.toPx() / size.height) to Color.Black), blendMode = BlendMode.DstIn)
},
) {
AsyncImage(
model = model, contentDescription = null, contentScale = ContentScale.Crop,
alignment = BiasAlignment(0.45f, -0.35f),
colorFilter = artFilter,
modifier = Modifier.matchParentSize(),
)
Box(
Modifier.matchParentSize().drawBehind {
drawRect(colors.background.copy(alpha = if (light) 0.1f else 0.12f + 0.3f * pale))
drawRect(
Brush.radialGradient(
0f to colors.background.copy(alpha = if (light) 0.5f else 0.66f),
0.55f to colors.background.copy(alpha = if (light) 0.2f else 0.3f),
1f to Color.Transparent,
center = Offset(size.width * 0.22f, size.height * 0.55f), radius = size.width * 0.55f,
),
)
},
)
}
}
}
private val ArtMin = 220.dp
private val ArtMax = 340.dp
/** A frosted surface: the page's wash behind it, a dark tint, and a thin rim. Plain surface when there is no backdrop. */
@Composable
internal fun Modifier.glass(shape: Shape, lift: Float = 0f): Modifier {
val g = LocalGlass.current
val colors = MaterialTheme.colorScheme
val pal = LocalPalette.current
if (g == null) return clip(shape).background(colors.surface).border(1.dp, pal.line2, shape)
val light = g.light
val tint = colors.background.copy(alpha = if (light) 0.62f else 0.46f + lift)
val rim = if (light) Color.Black.copy(alpha = 0.1f) else Color.White.copy(alpha = 0.12f + lift)
val self = remember { arrayOfNulls<LayoutCoordinates>(1) }
var placed by remember { mutableIntStateOf(0) }
val last = remember { longArrayOf(Long.MIN_VALUE) }
return clip(shape)
.onGloballyPositioned { c ->
self[0] = c
val at = g.offsetOf(c) ?: return@onGloballyPositioned
val key = (at.x.toLong() shl 32) xor (at.y.toLong() and 0xffffffffL)
if (key != last[0]) { last[0] = key; placed++ }
}
.drawBehind {
val base = g.coords?.size
if (placed >= 0 && g.ready && base != null) g.offsetOf(self[0])?.let { at ->
val wash = Size(base.width.toFloat(), base.height.toFloat())
drawIntoCanvas { canvas ->
canvas.saveLayer(Rect(0f, 0f, size.width, size.height), Paint())
translate(-at.x, -at.y) { g.paint(this, wash); g.fadeBottom(this, wash) }
canvas.restore()
}
}
drawRect(tint)
}
.border(1.dp, rim, shape)
}
@@ -18,6 +18,7 @@ import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.OpenInNew
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
@@ -70,7 +71,8 @@ private fun ResourceLink(link: GameResource) {
val pal = LocalPalette.current
val source = remember { MutableInteractionSource() }
val hot = rememberHot(source)
val shape = RoundedCornerShape(8.dp)
val glass = LocalGlass.current != null
val shape = if (glass) RoundedCornerShape(99.dp) else RoundedCornerShape(8.dp)
val label = stringResource(link.label)
val description = listOfNotNull(label, link.detail?.let { stringResource(it) }, stringResource(R.string.game_resources_browser)).joinToString(". ")
val open = { openUrl(ctx, link.url) }
@@ -78,13 +80,13 @@ private fun ResourceLink(link: GameResource) {
Row(
verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(5.dp),
modifier = Modifier.paneItem("resource:${link.label}").heightIn(min = 44.dp).clip(shape)
.background(if (hot) pal.signal.copy(alpha = 0.08f) else Color.Transparent)
.glideBorder(hot, shape, pal.signal, restColor = Color.Transparent)
.background(if (hot) pal.signal.copy(alpha = 0.14f) else if (glass) Color.White.copy(alpha = 0.07f) else Color.Transparent)
.glideBorder(hot, shape, pal.signal, restColor = if (glass) Color.White.copy(alpha = 0.12f) else Color.Transparent)
.semantics { contentDescription = description }
.hoverable(source).clickable(interactionSource = source, indication = LocalIndication.current, role = Role.Button, onClick = open)
.controllerConfirm(onClick = open).padding(horizontal = 8.dp),
.controllerConfirm(onClick = open).padding(horizontal = if (glass) 14.dp else 8.dp),
) {
Text(label, fontSize = 12.sp, fontWeight = FontWeight.Medium, color = tint, maxLines = 1)
Text(label, fontSize = if (glass) 13.sp else 12.sp, fontWeight = FontWeight.Medium, color = if (glass && !hot) MaterialTheme.colorScheme.onBackground else tint, maxLines = 1)
Icon(Icons.AutoMirrored.Filled.OpenInNew, contentDescription = null, tint = tint.copy(alpha = 0.65f), modifier = Modifier.size(11.dp))
}
}
@@ -0,0 +1,193 @@
package com.droiddeck.launcher.ui
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.background
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Build
import androidx.compose.material3.Text
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.Alignment
import androidx.compose.ui.draw.clip
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextOverflow
import com.droiddeck.launcher.R
import com.droiddeck.launcher.stores.InstalledStoreGame
import com.droiddeck.launcher.stores.formatBytes
import com.droiddeck.launcher.stores.StoreLanguage
import com.droiddeck.launcher.stores.download.DownloadQueue
import com.droiddeck.launcher.stores.download.DownloadState
import com.droiddeck.launcher.stores.gog.*
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
@Composable
internal fun GogMaintenanceActions(game: InstalledStoreGame) {
val ctx = LocalContext.current
val colors = MaterialTheme.colorScheme
val scope = rememberCoroutineScope()
var menu by remember { mutableStateOf(false) }
var patches by remember { mutableStateOf<List<GogOfflineDownload>?>(null) }
var proposal by remember { mutableStateOf<GogMaintenance.Proposal?>(null) }
var error by remember { mutableStateOf<String?>(null) }
var busy by remember { mutableStateOf(false) }
var recoverablePatch by remember { mutableStateOf(false) }
val key = "gog:${game.sidecar.id}"
val download = com.droiddeck.launcher.stores.StoresState.download(key)
val active = download?.isActive == true
val check = GogMaintenance.checks[game.sidecar.id]
LaunchedEffect(game.folder.path) { GogMaintenance.check(ctx, game) }
LaunchedEffect(menu, active) {
if (menu) {
recoverablePatch = false
val result = withContext(Dispatchers.IO) { runCatching {
GogFiles.read(GogFiles.journal(game.folder))?.let {
it.optString("operation") == GogOperation.PATCH.name && it.optString("phase") in setOf("patch-starting", "patch-applying", "patch-uncertain")
} == true
} }
result.onSuccess { recoverablePatch = it }.onFailure { error = it.message }
}
}
fun prepare(operation: GogOperation, patch: GogOfflineDownload? = null) {
menu = false; patches = null; busy = true; error = null
scope.launch {
runCatching { withContext(Dispatchers.IO) { GogMaintenance.prepare(ctx, game, operation, patch) } }
.onSuccess { proposal = it }.onFailure { error = it.message }
busy = false
}
}
if (active) {
ActionChip(downloadLabel(download!!), ok = false)
if (download.interruptible) {
SecondaryButton(stringResource(if (download.state == DownloadState.PAUSED) R.string.stores_dl_resume else R.string.stores_dl_pause)) {
if (download.state == DownloadState.PAUSED) DownloadQueue.resume(ctx, key) else DownloadQueue.pause(key)
}
} else Text(stringResource(R.string.gog_patch_in_session), color = MaterialTheme.colorScheme.onSurfaceVariant)
} else if (!game.sidecar.isInstalled || GogFiles.journal(game.folder).exists()) {
SecondaryButton(stringResource(R.string.gog_resume), modifier = Modifier.testTag("gog-resume")) {
busy = true
scope.launch {
runCatching {
withContext(Dispatchers.IO) {
GogMaintenance.resume(ctx, game)
}
}.onSuccess { proposal = it }.onFailure { error = it.message }
busy = false
}
}
} else if (check?.state == GogMaintenance.State.AVAILABLE) {
SecondaryButton(stringResource(R.string.gog_update, check.version.ifBlank { game.sidecar.title }), enabled = !busy, modifier = Modifier.testTag("gog-update")) { prepare(GogOperation.UPDATE) }
}
androidx.compose.foundation.layout.Box {
val manageLabel = stringResource(if (busy) R.string.common_checking else R.string.gog_maintenance)
if (LocalPillButtons.current) androidx.compose.foundation.layout.Box(Modifier.testTag("gog-maintenance")) {
IconAction(Icons.Outlined.Build, manageLabel, "game:gog-maintenance", enabled = !busy && !active) { menu = !menu }
} else SecondaryButton(manageLabel, enabled = !busy && !active, modifier = Modifier.testTag("gog-maintenance")) { menu = !menu }
AnchoredMenu(menu, { menu = false }, title = stringResource(R.string.gog_maintenance), compact = true) { first ->
MenuItem(stringResource(R.string.common_update), checked = false) { prepare(GogOperation.UPDATE) }
MenuItem(stringResource(R.string.gog_check), checked = false, focusRequester = first) { menu = false; GogMaintenance.check(ctx, game, true) }
MenuItem(stringResource(R.string.gog_repair), checked = false, modifier = Modifier.testTag("gog-repair")) { prepare(GogOperation.REPAIR) }
MenuItem(stringResource(R.string.gog_patches), checked = false, modifier = Modifier.testTag("gog-patches")) {
menu = false; busy = true
scope.launch {
runCatching { withContext(Dispatchers.IO) { GogMaintenance.offlinePatches(ctx, game) } }
.onSuccess { patches = it }.onFailure { error = it.message }
busy = false
}
}
MenuItem(stringResource(R.string.gog_refresh), checked = false) { prepare(GogOperation.REFRESH) }
if (recoverablePatch) MenuItem(stringResource(R.string.gog_recover), checked = false, modifier = Modifier.testTag("gog-recover")) {
menu = false; busy = true
scope.launch {
runCatching { withContext(Dispatchers.IO) { GogMaintenance.recoverPatch(ctx, game) } }.onFailure { error = it.message }
busy = false
}
}
}
}
if (check?.state == GogMaintenance.State.FAILED || check?.state == GogMaintenance.State.UNKNOWN) {
if (check.reason.isNotBlank()) Text(check.reason, fontSize = 12.sp, color = colors.onSurfaceVariant)
}
patches?.let { list ->
val shown = rememberShown { patches = null }
val close = { shown.targetState = false }
AppDialog(shown, close, "gogPatches", wide = false, maxWidth = 460.dp) {
DialogTitleRow(stringResource(R.string.gog_patches), close)
Text(game.sidecar.title, fontSize = 12.sp, lineHeight = 16.sp, color = colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis)
Text(stringResource(R.string.gog_patch_requirements), fontSize = 12.sp, lineHeight = 18.sp, color = colors.onSurfaceVariant)
if (list.isEmpty()) Text(stringResource(R.string.gog_no_patches), fontSize = 13.sp, color = colors.onSurfaceVariant)
Column(verticalArrangement = Arrangement.spacedBy(6.dp)) {
list.forEach { patch ->
ListRow(onClick = { close(); prepare(GogOperation.PATCH, patch) }) {
Column(Modifier.weight(1f), verticalArrangement = Arrangement.spacedBy(3.dp)) {
Text(patch.name, fontSize = 13.sp, lineHeight = 18.sp, fontWeight = FontWeight.Medium, color = colors.onBackground, maxLines = 2, overflow = TextOverflow.Ellipsis)
Text(listOf(StoreLanguage.displayName(patch.language).ifBlank { patch.language }, patch.version, formatBytes(patch.size)).filter { it.isNotBlank() }.joinToString(" · "),
fontSize = 11.sp, lineHeight = 15.sp, color = colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis)
}
Text(stringResource(R.string.gog_select_patch), fontSize = 12.sp, color = LocalPalette.current.signal)
}
}
}
SecondaryButton(stringResource(R.string.gog_refresh)) { prepare(GogOperation.REFRESH) }
}
}
proposal?.let { selected ->
val shown = rememberShown { proposal = null }
val close = { shown.targetState = false }
val action = when (selected.operation) {
GogOperation.UPDATE -> R.string.common_update
GogOperation.REPAIR -> R.string.gog_repair_action
GogOperation.PATCH -> R.string.gog_open_patch
GogOperation.REFRESH -> R.string.gog_refresh_action
}
AppDialog(shown, close, "gogMaintenance", wide = false, maxWidth = 460.dp) {
DialogTitleRow(stringResource(action), close)
Column(verticalArrangement = Arrangement.spacedBy(4.dp)) {
Text(listOf(game.sidecar.title, selected.before.version).filter { it.isNotBlank() }.joinToString(" · "), fontSize = 12.sp, lineHeight = 16.sp, color = colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis)
if (selected.operation != GogOperation.REPAIR) Text(selected.patch?.name ?: selected.target.version.ifBlank { selected.target.build }, fontSize = 15.sp, lineHeight = 20.sp, fontWeight = FontWeight.SemiBold,
color = colors.onBackground, maxLines = 2, overflow = TextOverflow.Ellipsis)
}
Row(horizontalArrangement = Arrangement.spacedBy(16.dp), modifier = Modifier.fillMaxWidth().clip(Shape12).background(colors.surface.copy(alpha = 0.65f)).padding(12.dp)) {
GogMetric(stringResource(R.string.gog_download_label), formatBytes(selected.downloadBytes), Modifier.weight(1f))
GogMetric(stringResource(if (selected.operation == GogOperation.PATCH || selected.operation == GogOperation.REFRESH) R.string.gog_space_estimate_label else R.string.gog_space_label),
formatBytes(selected.diskBytes), Modifier.weight(1f))
}
Column(verticalArrangement = Arrangement.spacedBy(6.dp)) {
Text(stringResource(R.string.gog_managed_files), fontSize = 12.sp, lineHeight = 18.sp, color = colors.onSurfaceVariant)
if (selected.fullFiles) Text(stringResource(R.string.gog_full_files), fontSize = 12.sp, lineHeight = 18.sp, color = colors.onSurfaceVariant)
if (selected.operation == GogOperation.PATCH) Text(stringResource(R.string.gog_patch_installer_note), fontSize = 12.sp, lineHeight = 18.sp, color = colors.onSurfaceVariant)
}
Row(horizontalArrangement = Arrangement.spacedBy(8.dp), verticalAlignment = Alignment.CenterVertically) {
PrimaryButton(stringResource(action), enabled = !busy, modifier = Modifier.testTag("gog-apply")) {
busy = true
close()
scope.launch {
runCatching { withContext(Dispatchers.IO) { GogMaintenance.enqueue(ctx, game, selected) } }.onFailure { error = it.message }
busy = false
}
}
SecondaryButton(stringResource(R.string.common_cancel), onClick = close)
}
}
}
error?.let { Text(it, fontSize = 12.sp, color = colors.error) }
}
@Composable
private fun GogMetric(label: String, value: String, modifier: Modifier) {
Column(modifier, verticalArrangement = Arrangement.spacedBy(4.dp)) {
Text(label, fontSize = 11.sp, lineHeight = 15.sp, color = MaterialTheme.colorScheme.onSurfaceVariant)
Text(value, fontSize = 15.sp, lineHeight = 20.sp, fontWeight = FontWeight.SemiBold, color = MaterialTheme.colorScheme.onBackground)
}
}
@@ -3,6 +3,8 @@ package com.droiddeck.launcher.ui
import android.view.KeyEvent
import androidx.activity.compose.BackHandler
import androidx.compose.animation.core.Spring
import androidx.compose.animation.core.tween
import androidx.compose.animation.core.FastOutSlowInEasing
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.foundation.LocalIndication
import androidx.compose.foundation.background
@@ -17,6 +19,8 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
@@ -27,6 +31,7 @@ import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.GridItemSpan
import androidx.compose.foundation.lazy.grid.LazyGridScope
import androidx.compose.foundation.gestures.animateScrollBy
import androidx.compose.foundation.lazy.grid.LazyGridState
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.foundation.lazy.grid.items
@@ -35,12 +40,15 @@ import androidx.compose.foundation.selection.selectable
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Add
import androidx.compose.material.icons.filled.FilterAlt
import androidx.compose.material.icons.filled.GridView
import androidx.compose.material.icons.filled.PlayArrow
import androidx.compose.material.icons.filled.Remove
import androidx.compose.material.icons.filled.Sort
import androidx.compose.material.icons.filled.ViewList
import androidx.compose.material.icons.filled.ViewModule
import androidx.compose.material.icons.filled.Visibility
import androidx.compose.material.icons.outlined.Download
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
@@ -55,11 +63,13 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.blur
import androidx.compose.ui.draw.clip
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.focus.onFocusChanged
import androidx.compose.ui.geometry.Rect
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.input.key.onPreviewKeyEvent
@@ -88,10 +98,13 @@ import com.droiddeck.launcher.stores.StoreSizes
import com.droiddeck.launcher.stores.StoresState
import com.droiddeck.launcher.stores.arrangeStoreTabs
import com.droiddeck.launcher.stores.download.DownloadEntry
import com.droiddeck.launcher.stores.download.DownloadStage
import com.droiddeck.launcher.stores.download.DownloadState
import com.droiddeck.launcher.stores.formatBytes
import com.droiddeck.launcher.stores.itch.ItchCollection
import com.droiddeck.launcher.stores.itch.ItchCollections
import com.droiddeck.launcher.stores.itch.ItchUpdates
import com.droiddeck.launcher.stores.gog.GogMaintenance
import com.droiddeck.launcher.stores.retainOrder
import com.droiddeck.launcher.stores.xbox.XboxLibraryFilter
import com.droiddeck.launcher.stores.sortGames
@@ -146,6 +159,37 @@ internal fun librarySources(entries: List<LibraryEntry>, order: List<String>): L
.filter { source -> entries.any { it.source == source } }
/** Survives leaving the page, so Stores can open the Library on one store's owned games. */
internal object LibraryDisplay {
val scales = listOf(0.75f, 0.875f, 1f, 1.2f, 1.45f)
var level by mutableIntStateOf(2)
private set
var title by mutableStateOf(true)
private set
var size by mutableStateOf(true)
private set
fun load(context: android.content.Context) {
level = SessionPrefs.libraryCardLevel(context).coerceIn(0, scales.lastIndex)
title = SessionPrefs.libraryShowTitle(context)
size = SessionPrefs.libraryShowSize(context)
}
fun step(context: android.content.Context, by: Int) {
level = (level + by).coerceIn(0, scales.lastIndex)
SessionPrefs.setLibraryCardLevel(context, level)
}
fun toggleTitle(context: android.content.Context) {
title = !title
SessionPrefs.setLibraryShowTitle(context, title)
}
fun toggleSize(context: android.content.Context) {
size = !size
SessionPrefs.setLibraryShowSize(context, size)
}
}
internal object LibraryView {
var source by mutableStateOf(LIBRARY_ALL)
var query by mutableStateOf("")
@@ -170,6 +214,7 @@ internal fun LibraryPage(s: FrontEndState, a: FrontEndActions, selected: String,
val focusManager = androidx.compose.ui.platform.LocalFocusManager.current
val inputMode = androidx.compose.ui.platform.LocalInputModeManager.current
LaunchedEffect(Unit) { StoresState.refresh(ctx) }
remember { LibraryDisplay.load(ctx) }
val stores = s.gameStoresEnabled && !s.shortcutPicker
val signedIn = Store.entries.filter { StoresState.isSignedIn(it) }
LaunchedEffect(stores, signedIn) { if (stores) signedIn.forEach { StoresState.loadLibrary(ctx, it) } }
@@ -309,6 +354,7 @@ internal fun LibraryPage(s: FrontEndState, a: FrontEndActions, selected: String,
gridScrolled = { grid.firstVisibleItemIndex > 0 || grid.firstVisibleItemScrollOffset > 0 },
onDetailFocus = { detailFocused = it },
modifier = modifier.padding(horizontal = if (narrow) 14.dp else 22.dp).padding(top = if (narrow) 10.dp else 14.dp),
bleedHorizontal = if (narrow) 14.dp else 22.dp, bleedTop = if (narrow) 10.dp else 14.dp,
wrap = { key, content -> StoreTheme(GameRef.parse(key).let { r -> r.store ?: r.game(s.steamGames)?.source?.let { Store.byId(it) } }) { content() } },
grid = {
LibraryGrid(
@@ -358,7 +404,7 @@ private fun LibraryGrid(
) {
val listMode = s.storesView == "list"
val capsules = s.storesView == "capsules"
val tileWidth = if (capsules) CapsuleWidth else CardWidth
val tileWidth = (if (capsules) CapsuleWidth else if (listMode) CardWidth else LibraryCardWidth) * LibraryDisplay.scales[LibraryDisplay.level]
val focus = LocalFrontFocus.current
val scope = rememberCoroutineScope()
val density = androidx.compose.ui.platform.LocalDensity.current
@@ -382,10 +428,11 @@ private fun LibraryGrid(
if (key.action == KeyEvent.ACTION_DOWN) {
val target = "card:${visible[next].key}"
val targetIndex = headerItems + next + if (split == 0) 0 else if (next < split) 1 else 2
val currentIndex = headerItems + index + if (split == 0) 0 else if (index < split) 1 else 2
val shown = grid.layoutInfo.visibleItemsInfo.any { it.index == targetIndex }
if (!shown || (focus.attached[target] ?: 0) == 0 ||
runCatching { focus.items.getValue(target).requestFocus() }.isFailure) scope.launch {
grid.scrollToItem(targetIndex)
launch { grid.revealRow(currentIndex, targetIndex, direction, with(density) { 10.dp.toPx() }) }
focusWithinFrames({ focus.last == target }) { focus.items[target] ?: FocusRequester.Default }
}
}
@@ -395,7 +442,7 @@ private fun LibraryGrid(
}
val picker = s.shortcutPicker && e.game != null
val choose = if (picker) ({ a.onSteamGame(e.game!!) }) else null
if (listMode) LibraryRow(e, first, navigation, choose, onOpen) else LibraryTile(e, capsules, first, navigation, choose, onOpen)
if (listMode) LibraryRow(e, first, navigation, choose, onOpen) else LibraryTile(e, capsules, first, navigation, choose, onOpen, showSource = source == LIBRARY_ALL)
}
LazyVerticalGrid(
columns = if (listMode) GridCells.Fixed(1) else GridCells.Adaptive(tileWidth), state = grid,
@@ -443,6 +490,20 @@ private fun LibraryGrid(
}
}
internal suspend fun LazyGridState.revealRow(currentIndex: Int, targetIndex: Int, direction: Int, gapPx: Float) {
val current = layoutInfo.visibleItemsInfo.firstOrNull { it.index == currentIndex }
if (current != null) {
val row = current.size.height + gapPx
val delta = if (direction > 0) {
current.offset.y + 2 * row - gapPx - (layoutInfo.viewportSize.height - layoutInfo.afterContentPadding)
} else {
current.offset.y - row - layoutInfo.beforeContentPadding
}
if (direction > 0 && delta > 0f || direction < 0 && delta < 0f) animateScrollBy(delta, tween(durationMillis = 160, easing = FastOutSlowInEasing))
}
if (layoutInfo.visibleItemsInfo.none { it.index == targetIndex }) scrollToItem(targetIndex)
}
private fun LazyGridScope.libraryGrid(entries: List<LibraryEntry>, empty: Int, tile: @Composable (LibraryEntry) -> Unit) {
if (entries.isEmpty()) item(key = "empty", span = { GridItemSpan(maxLineSpan) }) {
Box(Modifier.padding(vertical = 32.dp).fillMaxWidth(), contentAlignment = Alignment.Center) {
@@ -462,7 +523,7 @@ private fun LibraryHeader(
ModeHeader(
stringResource(R.string.rail_games), LibraryView.query, { LibraryView.query = it },
placeholder = stringResource(R.string.stores_search_library),
clearSearchFocus = searchCleared,
clearSearchFocus = searchCleared, inlineWhenStacked = true,
lead = {
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp), modifier = Modifier.padding(start = 2.dp, end = 4.dp)) {
Text(stringResource(R.string.rail_games), fontSize = if (narrow) 20.sp else 24.sp, fontWeight = FontWeight.Bold, color = colors.onBackground, maxLines = 1)
@@ -471,6 +532,7 @@ private fun LibraryHeader(
}
},
) {
DisplayButton()
if (showUninstalled != null || xbox) LibraryFilterButton(showUninstalled, onShowUninstalled, xbox)
if (collections) CollectionsButton()
SortButton(s, a)
@@ -530,7 +592,7 @@ private fun entryArt(e: LibraryEntry, tall: Boolean): Any? {
}
@Composable
private fun LibraryTile(e: LibraryEntry, capsule: Boolean, first: Boolean, navigation: Modifier, choose: (() -> Unit)?, onOpen: (String) -> Unit) {
private fun LibraryTile(e: LibraryEntry, capsule: Boolean, first: Boolean, navigation: Modifier, choose: (() -> Unit)?, onOpen: (String) -> Unit, showSource: Boolean) {
val pal = LocalPalette.current
val src = remember { MutableInteractionSource() }
val hot = rememberHot(src)
@@ -554,9 +616,60 @@ private fun LibraryTile(e: LibraryEntry, capsule: Boolean, first: Boolean, navig
.hoverable(src).clickable(role = Role.Button, interactionSource = src, indication = LocalIndication.current, onClick = open)
.controllerConfirm(onClick = choose ?: open),
) {
CardFace(e.title, wide, tall, download, hot, capsule, dim = !e.installed && download == null,
badge = { SourceChip(e.source, small = true, modifier = Modifier.align(Alignment.TopStart).padding(6.dp)) }) {
LibraryMarker(e, download)
LibraryArt(e, wide, tall, download, hot, capsule, showSource)
}
}
private val LibraryCardWidth = 150.dp
@Composable
private fun LibraryArt(e: LibraryEntry, wide: Any?, tall: Any?, download: DownloadEntry?, hot: Boolean, capsule: Boolean, showSource: Boolean) {
val url = if (capsule) tall ?: wide else wide ?: tall
val art = cardArtRequest(url, tall)
val ratio = if (capsule) 5f / 7f else 16f / 9f
var offRatio by remember(url) { mutableStateOf(false) }
var trim by remember(url) { mutableStateOf(false) }
val blurs = android.os.Build.VERSION.SDK_INT >= 31
Box(
Modifier.fillMaxWidth().aspectRatio(ratio).background(Color(0xFF101318))
.then(if (url == null) Modifier.background(artBrush(hueOf(e.title))) else Modifier),
) {
if (art != null && offRatio) {
AsyncImage(model = art, contentDescription = null, contentScale = ContentScale.Crop, modifier = Modifier.matchParentSize().blur(32.dp))
Spacer(Modifier.matchParentSize().background(Color.Black.copy(alpha = if (blurs) 0.18f else 0.6f)))
}
if (art != null) AsyncImage(
model = art, contentDescription = null, contentScale = if (trim) ContentScale.Crop else ContentScale.Fit, modifier = Modifier.matchParentSize(),
onSuccess = { r ->
val d = r.result.drawable
if (d.intrinsicWidth > 0 && d.intrinsicHeight > 0) {
val shape = d.intrinsicWidth.toFloat() / d.intrinsicHeight
trim = !capsule && shape > ratio * 1.25f
offRatio = !trim && kotlin.math.abs(shape / ratio - 1f) > 0.03f
}
},
)
if (showSource) SourceChip(e.source, small = true, modifier = Modifier.align(Alignment.TopStart).padding(6.dp))
val state = when {
download != null -> "${download.percent}%"
e.item != null && StoresState.isUnfinished(e.item) -> stringResource(R.string.stores_resume)
e.installed && libraryUpdateAvailable(e) -> stringResource(R.string.common_update)
else -> null
}
if (state != null) Box(Modifier.align(Alignment.TopEnd).padding(6.dp)) { StateChip(state, ChipTone.BUSY, small = true) }
val showName = LibraryDisplay.title || hot
val showSize = LibraryDisplay.size || hot
if (showName || showSize) Column(
verticalArrangement = Arrangement.spacedBy(1.dp),
modifier = Modifier.align(Alignment.BottomCenter).fillMaxWidth()
.background(Brush.verticalGradient(0f to Color.Transparent, 0.6f to Color.Black.copy(alpha = 0.78f), 1f to Color.Black.copy(alpha = 0.92f)))
.padding(start = 8.dp, end = 8.dp, top = 20.dp, bottom = if (download != null) 14.dp else 6.dp),
) {
if (showName) Text(e.title, fontSize = 11.sp, fontWeight = FontWeight.Bold, color = Color.White, maxLines = if (hot) 2 else 1, overflow = TextOverflow.Ellipsis, lineHeight = 13.sp)
if (showSize) LibrarySize(e)
}
if (download != null) Box(Modifier.align(Alignment.BottomCenter).padding(start = 6.dp, end = 6.dp, bottom = 5.dp)) {
ProgressBarThin(download.fraction, paused = download.state == DownloadState.PAUSED, verify = download.stage == DownloadStage.VERIFY)
}
}
}
@@ -576,23 +689,34 @@ private fun RequestSize(e: LibraryEntry) {
LaunchedEffect(item.key) { StoreSizes.request(ctx, item) }
}
private fun librarySize(e: LibraryEntry): Long? = if (e.installed) e.storeKey?.let { StoreSizes.onDisk[it] }
?: e.game?.gameFiles?.let { FolderSizes.known[it.path] }
else e.item?.let { StoreSizes.size(it) }?.takeIf { it > 0 }
@Composable
internal fun LibraryMarker(e: LibraryEntry, download: DownloadEntry?) {
private fun LibrarySize(e: LibraryEntry) {
val size = librarySize(e)?.takeIf { it > 0 } ?: return
Text(formatBytes(size), fontSize = 11.sp, fontWeight = FontWeight.Bold, color = Color.White, maxLines = 1)
}
@Composable
internal fun LibraryMarker(e: LibraryEntry, download: DownloadEntry?, showDownload: Boolean = true) {
val pal = LocalPalette.current
val size = if (e.installed) e.storeKey?.let { StoreSizes.onDisk[it] }
?: e.game?.gameFiles?.let { FolderSizes.known[it.path] }
else e.item?.let { StoreSizes.size(it) }?.takeIf { it > 0 }
val size = librarySize(e)
when {
download != null -> Text("${download.percent}%", fontSize = 10.sp, fontWeight = FontWeight.Bold, color = pal.signal, maxLines = 1)
e.item != null && StoresState.isUnfinished(e.item) -> Text(stringResource(R.string.stores_resume), fontSize = 10.sp, fontWeight = FontWeight.Bold, color = pal.signal, maxLines = 1)
else -> Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(3.dp)) {
if (e.installed && e.storeKey?.let { it in ItchUpdates.available } == true) Text(stringResource(R.string.common_update), fontSize = 10.sp, fontWeight = FontWeight.Bold, color = pal.signal, maxLines = 1)
if (e.installed && libraryUpdateAvailable(e)) Text(stringResource(R.string.common_update), fontSize = 10.sp, fontWeight = FontWeight.Bold, color = pal.signal, maxLines = 1)
if (size != null && size > 0) Text(formatBytes(size), fontSize = 11.sp, fontWeight = FontWeight.Bold, color = Color.White, maxLines = 1)
if (!e.installed) Icon(Icons.Outlined.Download, stringResource(R.string.stores_section_not_installed), tint = Color.White, modifier = Modifier.size(12.dp))
if (!e.installed && showDownload) Icon(Icons.Outlined.Download, stringResource(R.string.stores_section_not_installed), tint = Color.White, modifier = Modifier.size(12.dp))
}
}
}
private fun libraryUpdateAvailable(e: LibraryEntry): Boolean = e.storeKey?.let { it in ItchUpdates.available } == true ||
e.source == Store.GOG.id && (e.item?.id ?: e.game?.storeId)?.let { GogMaintenance.checks[it]?.state } == GogMaintenance.State.AVAILABLE
@Composable
private fun LibraryRow(e: LibraryEntry, first: Boolean, navigation: Modifier, choose: (() -> Unit)?, onOpen: (String) -> Unit) {
val colors = MaterialTheme.colorScheme
@@ -613,6 +737,7 @@ private fun LibraryRow(e: LibraryEntry, first: Boolean, navigation: Modifier, ch
val size = if (e.installed && folder != null) diskSize(inst, folder) else e.item?.let { StoreSizes.size(it) }?.takeIf { it > 0 }
val status = when {
download != null -> downloadLabel(download)
e.installed && libraryUpdateAvailable(e) -> stringResource(R.string.common_update)
!e.installed -> stringResource(R.string.stores_section_not_installed)
e.game != null -> playedSpan(e.game.lastPlayed)?.replaceFirstChar { it.uppercase() } ?: stringResource(R.string.games_never_played)
else -> stringResource(R.string.stores_installed_chip)
@@ -760,6 +885,45 @@ private fun CollectionsButton() {
}
}
@Composable
private fun DisplayButton() {
val pal = LocalPalette.current
val ctx = LocalContext.current
val title = stringResource(R.string.library_display)
var at by remember { mutableStateOf<Rect?>(null) }
Box(Modifier.onGloballyPositioned { at = it.boundsInRoot() }) {
HeaderIconButton(title, Icons.Filled.Visibility, "display") {
val from = at ?: return@HeaderIconButton
Steps.ask(StepAsk(
anchor = from, side = StepSide.Left, accent = pal.signal, pillCorner = 8.dp, items = 4,
handle = { Icon(Icons.Filled.Visibility, null, tint = pal.signal, modifier = Modifier.size(18.dp)) },
) {
StepTitle(title)
StepList {
val last = LibraryDisplay.scales.lastIndex
StepChoice(
stringResource(R.string.library_display_larger), icon = Icons.Filled.Add, enabled = open && LibraryDisplay.level < last,
trailing = "${LibraryDisplay.level + 1}/${last + 1}",
modifier = Modifier.fillMaxWidth().stepItem(0).focusRequester(first),
) { LibraryDisplay.step(ctx, 1) }
StepChoice(
stringResource(R.string.library_display_smaller), icon = Icons.Filled.Remove, enabled = open && LibraryDisplay.level > 0,
modifier = Modifier.fillMaxWidth().stepItem(1),
) { LibraryDisplay.step(ctx, -1) }
StepChoice(
stringResource(R.string.library_display_title), selected = LibraryDisplay.title, enabled = open,
modifier = Modifier.fillMaxWidth().stepItem(2),
) { LibraryDisplay.toggleTitle(ctx) }
StepChoice(
stringResource(R.string.library_display_size), selected = LibraryDisplay.size, enabled = open,
modifier = Modifier.fillMaxWidth().stepItem(3),
) { LibraryDisplay.toggleSize(ctx) }
}
})
}
}
}
@Composable
private fun SortButton(s: FrontEndState, a: FrontEndActions) {
val pal = LocalPalette.current
@@ -4,7 +4,8 @@ internal enum class SessionDrawerPage(val firstControl: String) {
CONTROLLER("touch"),
GLASSES("glasses-game"),
SECOND_SCREEN("second-screen:none"),
DISPLAY("hud"),
DISPLAY("fg"),
HUD("hud"),
EFFECTS("look"),
VR("steamvr"),
GAMES("anisotropy"),
@@ -18,7 +18,6 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.semantics.Role
import com.droiddeck.launcher.frontend.Library
import com.droiddeck.launcher.session.LoadingState
import com.droiddeck.launcher.session.PerfHud
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import androidx.compose.animation.core.FastOutSlowInEasing
@@ -81,8 +80,8 @@ import androidx.compose.ui.text.style.TextOverflow
@Composable
fun HudText(text: String, graph: FloatArray = FloatArray(0), color: String = "mint", opacity: Int = 70) {
if (text.isEmpty() && graph.size < 2) return
fun HudText(text: String, color: String = "mint", opacity: Int = 70) {
if (text.isEmpty()) return
val accent = hudInk(color)
val wash = (opacity.coerceIn(30, 100) / 100f)
val ink = accent.copy(alpha = (0.5f + wash * 0.5f).coerceIn(0.62f, 1f))
@@ -99,49 +98,13 @@ fun HudText(text: String, graph: FloatArray = FloatArray(0), color: String = "mi
)
.padding(horizontal = 8.dp, vertical = 5.dp),
) {
if (text.isNotEmpty()) Text(
Text(
text,
fontFamily = FontFamily.Monospace,
fontSize = 12.sp,
color = ink,
textAlign = TextAlign.End,
)
if (graph.size >= 2) {
if (text.isNotEmpty()) Spacer(Modifier.height(4.dp))
HudGraph(graph, accent, wash)
}
}
}
}
@Composable
private fun HudGraph(samples: FloatArray, accent: Color, wash: Float) {
Canvas(Modifier.width(148.dp).height(44.dp)) {
val maxMs = PerfHud.GRAPH_MAX_MS
val step = size.width / (samples.size - 1)
fun yOf(ms: Float) = size.height * (1f - (ms / maxMs).coerceIn(0f, 1f))
val fillAlpha = wash * 0.5f
val fill = Path().apply {
moveTo(0f, size.height)
samples.forEachIndexed { i, ms -> lineTo(i * step, yOf(ms)) }
lineTo(size.width, size.height)
close()
}
drawPath(
fill,
Brush.verticalGradient(listOf(HUD_SLOW.copy(alpha = fillAlpha), accent.copy(alpha = fillAlpha * 0.45f))),
)
val guide = yOf(16.7f)
drawLine(Color.White.copy(alpha = 0.32f), Offset(0f, guide), Offset(size.width, guide), strokeWidth = 1f)
for (i in 0 until samples.lastIndex) {
val tone = ((samples[i] - 8f) / 25f).coerceIn(0f, 1f)
drawLine(
mix(accent, HUD_SLOW, tone).copy(alpha = 0.55f + wash * 0.4f),
Offset(i * step, yOf(samples[i])),
Offset((i + 1) * step, yOf(samples[i + 1])),
strokeWidth = 2.5f,
cap = StrokeCap.Round,
)
}
}
}
@@ -156,17 +119,6 @@ private fun hudInk(color: String): Color = Color(
}.toInt(),
)
private fun mix(from: Color, to: Color, t: Float): Color {
val u = t.coerceIn(0f, 1f)
return Color(
red = from.red + (to.red - from.red) * u,
green = from.green + (to.green - from.green) * u,
blue = from.blue + (to.blue - from.blue) * u,
alpha = 1f,
)
}
private val HUD_SLOW = Color(0xFFFF5C6C.toInt())
private class LoadStage(@androidx.annotation.StringRes val label: Int, @androidx.annotation.StringRes val detail: Int)
@@ -42,6 +42,7 @@ import androidx.compose.material.icons.outlined.Pause
import androidx.compose.material.icons.outlined.PictureInPictureAlt
import androidx.compose.material.icons.automirrored.outlined.ExitToApp
import androidx.compose.material.icons.outlined.Settings
import androidx.compose.material.icons.outlined.Speed
import androidx.compose.material.icons.outlined.SportsEsports
import androidx.compose.material3.Icon
import androidx.compose.material3.RadioButton
@@ -157,6 +158,7 @@ private val SessionDrawerPage.title: Int get() = when (this) {
SessionDrawerPage.GLASSES -> R.string.drawer_page_glasses
SessionDrawerPage.SECOND_SCREEN -> R.string.drawer_second_screen
SessionDrawerPage.DISPLAY -> R.string.drawer_page_display
SessionDrawerPage.HUD -> R.string.drawer_hud
SessionDrawerPage.VR -> R.string.vr_title
SessionDrawerPage.EFFECTS -> R.string.drawer_page_effects
SessionDrawerPage.GAMES -> R.string.game_settings_title
@@ -168,6 +170,7 @@ private val SessionDrawerPage.icon get() = when (this) {
SessionDrawerPage.GLASSES -> GlassesIcon
SessionDrawerPage.SECOND_SCREEN -> Icons.Outlined.ScreenShare
SessionDrawerPage.DISPLAY -> Icons.Outlined.DesktopWindows
SessionDrawerPage.HUD -> Icons.Outlined.Speed
SessionDrawerPage.VR -> VrHeadsetIcon
SessionDrawerPage.EFFECTS -> Icons.Outlined.AutoFixHigh
SessionDrawerPage.GAMES -> Icons.Outlined.Layers
@@ -201,11 +204,7 @@ class DrawerActions(
val isHomeApp: Boolean,
val androidApps: List<HomeApp.LaunchableApp>,
val hudOn: Boolean,
val hudFps: Boolean = true,
val hudBattery: Boolean = true,
val hudGraph: Boolean = true,
val hudColor: String = SessionPrefs.HUD_COLOR_MINT,
val hudOpacity: Int = SessionPrefs.HUD_OPACITY_DEFAULT,
val hudConfig: Map<String, String> = emptyMap(),
val frameGen: FrameGen.Mode,
val lossless: Lossless.State,
val oscMode: String,
@@ -238,11 +237,9 @@ class DrawerActions(
val secondScreenDisplays: List<SecondScreenDisplay>,
val selectedSecondScreenDisplay: Int,
val onHud: (Boolean) -> Unit,
val onHudFps: (Boolean) -> Unit = {},
val onHudBattery: (Boolean) -> Unit = {},
val onHudGraph: (Boolean) -> Unit = {},
val onHudColor: (String) -> Unit = {},
val onHudOpacity: (Int) -> Unit = {},
val onHudSetting: (String, String) -> Unit = { _, _ -> },
val onHudReset: () -> Unit = {},
val onHudExport: () -> Unit = {},
val onFrameGenPick: (FrameGen.Mode) -> Unit,
val onImportLossless: () -> Unit,
val onKeyboard: () -> Unit,
@@ -495,34 +492,9 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
modifier = Modifier.weight(1f).fillMaxWidth().verticalScroll(pageScroll.getValue(page)),
) { CompositionLocalProvider(LocalChipMinWidth provides 96.dp, LocalCompactSettings provides true) {
when (page) {
SessionDrawerPage.HUD -> FusionHudSettings(host, a) { key -> focus.track(page, key) }
SessionDrawerPage.DISPLAY -> {
SettingsGroup(stringResource(R.string.drawer_page_display)) {
ToggleRow(host, "hud", stringResource(R.string.drawer_hud), null, a.hudOn,
chipModifier = focus.track(page, "hud"), onChange = a.onHud)
if (a.hudOn) {
ToggleRow(host, "hud-fps", stringResource(R.string.drawer_hud_fps), null, a.hudFps,
chipModifier = focus.track(page, "hud-fps"), onChange = a.onHudFps)
ToggleRow(host, "hud-battery", stringResource(R.string.drawer_hud_battery), null, a.hudBattery,
chipModifier = focus.track(page, "hud-battery"), onChange = a.onHudBattery)
ToggleRow(host, "hud-graph", stringResource(R.string.drawer_hud_graph), null, a.hudGraph,
chipModifier = focus.track(page, "hud-graph"), onChange = a.onHudGraph)
ChoiceRow(
host, "hud-color", stringResource(R.string.drawer_hud_color), null,
listOf(
SessionPrefs.HUD_COLOR_MINT to stringResource(R.string.drawer_hud_color_mint),
"white" to stringResource(R.string.drawer_hud_color_white),
"sky" to stringResource(R.string.drawer_hud_color_sky),
"amber" to stringResource(R.string.drawer_hud_color_amber),
"violet" to stringResource(R.string.drawer_hud_color_violet),
),
a.hudColor, chipModifier = focus.track(page, "hud-color"), onPick = a.onHudColor,
)
SliderRow(
stringResource(R.string.drawer_hud_opacity), null, a.hudOpacity,
SessionPrefs.HUD_OPACITY_RANGE, step = 10, format = { "$it%" },
modifier = focus.track(page, "hud-opacity"), onChange = a.onHudOpacity,
)
}
val fgOpen = host.open == "fg"
val fgLabel = FrameGen.label(LocalContext.current, a.frameGen)
SettingsRow(stringResource(R.string.frame_gen_title), null, highlighted = fgOpen) {
@@ -210,7 +210,7 @@ internal fun TabStrip(
}
@Composable
private fun BumperKey(label: String, description: String, onClick: () -> Unit) {
internal fun BumperKey(label: String, description: String, onClick: () -> Unit) {
val colors = MaterialTheme.colorScheme
val pal = LocalPalette.current
val cap = RoundedCornerShape(7.dp)
@@ -270,13 +270,10 @@ private fun Overview(report: StorageReport, sessionRunning: Boolean, onCleanUp:
val safe = StorageState.safeBytes(report)
val low = report.free < StorageState.LOW_SPACE_BYTES
ActionStatus()
Row(
verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(18.dp),
modifier = Modifier.fillMaxWidth().padding(top = 8.dp).clip(Shape14).background(colors.surface).border(1.dp, pal.line, Shape14)
.padding(horizontal = 18.dp, vertical = 14.dp),
) {
Column(Modifier.weight(1f)) {
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp)) {
val summary = Modifier.fillMaxWidth().padding(top = 8.dp).clip(Shape14).background(colors.surface).border(1.dp, pal.line, Shape14)
.padding(horizontal = 18.dp, vertical = 14.dp)
val usage: @Composable (Modifier) -> Unit = { m -> Column(m) {
FlowRow(verticalArrangement = Arrangement.spacedBy(4.dp), horizontalArrangement = Arrangement.spacedBy(8.dp)) {
Text(stringResource(R.string.storage_internal), fontSize = 17.sp, fontWeight = FontWeight.Bold, color = colors.onBackground)
Text("· " + stringResource(R.string.storage_used_of, gb(used), gb(report.total)), fontSize = 15.sp, color = colors.onSurfaceVariant)
Pill(stringResource(R.string.storage_free, gb(report.free)), if (low) AttentionAmber else pal.good)
@@ -292,14 +289,21 @@ private fun Overview(report: StorageReport, sessionRunning: Boolean, onCleanUp:
Bucket.entries.forEach { Legend(BucketColors.getValue(it), bucketLabel(it)) }
Legend(OtherApps, stringResource(R.string.storage_other_apps))
}
}
} }
val freeable: @Composable (Modifier) -> Unit = { m -> Column(m) {
Text(stringResource(R.string.storage_safe_now), fontSize = 13.sp, color = colors.onSurfaceVariant)
Text(gb(safe), fontSize = 26.sp, fontWeight = FontWeight.Bold, color = if (safe > 0) pal.good else colors.onBackground)
Text(stringResource(R.string.storage_safe_hint), fontSize = 12.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(bottom = 10.dp))
PrimaryButton(stringResource(R.string.storage_clean_up), enabled = !sessionRunning && !StorageState.cleaning, compact = true, onClick = onCleanUp)
} }
if (wide) Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(18.dp), modifier = summary) {
usage(Modifier.weight(1f))
Box(Modifier.width(1.dp).height(120.dp).background(pal.line))
Column(Modifier.widthIn(min = 170.dp, max = 210.dp)) {
Text(stringResource(R.string.storage_safe_now), fontSize = 13.sp, color = colors.onSurfaceVariant)
Text(gb(safe), fontSize = 26.sp, fontWeight = FontWeight.Bold, color = if (safe > 0) pal.good else colors.onBackground)
Text(stringResource(R.string.storage_safe_hint), fontSize = 12.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(bottom = 10.dp))
PrimaryButton(stringResource(R.string.storage_clean_up), enabled = !sessionRunning && !StorageState.cleaning, compact = true, onClick = onCleanUp)
}
freeable(Modifier.widthIn(min = 170.dp, max = 210.dp))
} else Column(verticalArrangement = Arrangement.spacedBy(12.dp), modifier = summary) {
usage(Modifier.fillMaxWidth())
Box(Modifier.fillMaxWidth().height(1.dp).background(pal.line))
freeable(Modifier.fillMaxWidth())
}
if (sessionRunning) {
Spacer(Modifier.height(8.dp))
@@ -846,17 +850,23 @@ private fun GameDataView(report: StorageReport, sessionRunning: Boolean, onBack:
val ctx = LocalContext.current
val busy = sessionRunning || StorageState.cleaning
var confirm by remember { mutableStateOf<com.droiddeck.launcher.storage.Leftover?>(null) }
var confirmPrefix by remember { mutableStateOf<com.droiddeck.launcher.storage.GameUsage?>(null) }
SubHeader(stringResource(R.string.storage_game_data), stringResource(R.string.storage_game_data_hint, gb(report.prefixes), gb(report.workshop), gb(report.shaders)), onBack)
ActionStatus()
if (sessionRunning) { Note(stringResource(R.string.storage_session_running)); Spacer(Modifier.height(4.dp)) }
val games = report.games.filter { it.data >= ONE_MB }.sortedByDescending { it.data }
val games = report.games.filter { it.data >= ONE_MB || it.prefixDir != null }.sortedByDescending { it.data }
SectionTitle(stringResource(R.string.storage_data_installed), gb(games.sumOf { it.data }))
ListCard {
if (games.isEmpty()) Text(stringResource(R.string.storage_no_games), fontSize = 14.sp, color = MaterialTheme.colorScheme.onSurfaceVariant, modifier = Modifier.padding(16.dp))
games.forEachIndexed { i, g ->
ItemRow(
gameName(g), stringResource(R.string.storage_data_parts, gb(g.prefix), gb(g.shaders), gb(g.workshop)), g.data, i == games.lastIndex,
action = { SecondaryButton(stringResource(R.string.storage_clear_shaders), compact = true, enabled = !busy && g.shaders >= ONE_MB) { StorageState.clearShaders(ctx, g.appId, g.x64) } },
action = {
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
SecondaryButton(stringResource(R.string.storage_clear_shaders), compact = true, enabled = !busy && g.shaders >= ONE_MB) { StorageState.clearShaders(ctx, g.appId, g.x64) }
SecondaryButton(stringResource(R.string.storage_reset_prefix), compact = true, enabled = !busy && g.prefixDir != null) { confirmPrefix = g }
}
},
)
}
}
@@ -888,6 +898,13 @@ private fun GameDataView(report: StorageReport, sessionRunning: Boolean, onBack:
SectionTitle(stringResource(R.string.storage_data_other), null)
ListCard { ItemRow(stringResource(R.string.storage_data_other_title), stringResource(R.string.storage_data_other_detail), report.otherPrefixes, true) }
}
confirmPrefix?.let { g ->
ConfirmDialog(
stringResource(R.string.storage_reset_prefix_title, gameName(g)),
stringResource(R.string.storage_reset_prefix_confirm, gb(g.prefix), g.library), stringResource(R.string.storage_reset_prefix),
onConfirm = { StorageState.resetPrefix(ctx, g) }, onDismiss = { confirmPrefix = null },
)
}
confirm?.let { l ->
ConfirmDialog(
stringResource(R.string.storage_remove_title, stringResource(R.string.storage_steam_app, l.appId)),
@@ -177,6 +177,60 @@ internal fun StoreGameFacts(developer: String, publisher: String, releaseDate: S
}
}
/** The headline scores, small enough to sit inside the action capsule. */
@Composable
internal fun CapsuleScores(scores: GameScores, modifier: Modifier = Modifier) {
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(2.dp), modifier = modifier) {
Looked(scores.metacritic, exit = fadeOut()) { lookup ->
val found = (lookup as? Lookup.Found)?.value
CapsuleStat(stringResource(R.string.stores_fact_metacritic), found?.url, showLabel = false) {
if (found != null) MetacriticBadge(found.score, small = true) else Placeholder(28.dp)
}
}
Looked(scores.hltb, exit = fadeOut()) { lookup ->
val found = (lookup as? Lookup.Found)?.value
val lead = found?.let { hltbRuns(it).firstOrNull() }
CapsuleStat(lead?.second ?: stringResource(R.string.stores_hltb_main), found?.url) {
if (lead != null) Text(hltbTime(lead.first), fontSize = 17.sp, fontWeight = FontWeight.Bold, color = MaterialTheme.colorScheme.onBackground, maxLines = 1)
else Placeholder(40.dp)
}
}
}
}
@Composable
private fun CapsuleStat(label: String, link: String?, showLabel: Boolean = true, value: @Composable () -> Unit) {
val colors = MaterialTheme.colorScheme
val src = remember { MutableInteractionSource() }
val hot = link != null && rememberHot(src)
Row(
verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(7.dp),
modifier = Modifier.then(linkSurface(label, link, src, hot, CapsuleStatShape)).padding(horizontal = 10.dp, vertical = 6.dp),
) {
value()
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(3.dp)) {
val tint = colors.onSurfaceVariant.copy(alpha = if (hot) 1f else 0.85f)
if (showLabel) Text(label.uppercase(), fontSize = 10.sp, fontWeight = FontWeight.SemiBold, letterSpacing = 1.sp, color = tint, maxLines = 1)
if (link != null) Icon(Icons.AutoMirrored.Filled.OpenInNew, contentDescription = if (showLabel) null else label, tint = tint, modifier = Modifier.size(10.dp))
}
}
}
/** Credits and times as label and value rows, for the details panel. */
@Composable
internal fun StoreDetailRows(developer: String, publisher: String, releaseDate: String, scores: GameScores) {
val released = remember(releaseDate) { GameFacts.releaseLabel(releaseDate) }
val publishedBy = publisher.takeUnless { it.isBlank() || it.trim().equals(developer.trim(), ignoreCase = true) }
val credits = listOf(
stringResource(R.string.stores_fact_developer) to developer,
stringResource(R.string.stores_fact_publisher) to publishedBy.orEmpty(),
stringResource(R.string.stores_fact_released) to released.orEmpty(),
).filter { it.second.isNotBlank() }
val runs = ((scores.hltb as? Lookup.Found)?.value)?.let { hltbRuns(it) }.orEmpty()
credits.forEach { (label, value) -> FactRow(label, value, labelWidth = 96.dp) }
runs.forEach { (secs, what) -> FactRow(what, hltbTime(secs), labelWidth = 96.dp) }
}
@Composable
private fun LineLink(label: String, link: String, content: @Composable () -> Unit) {
val pal = LocalPalette.current
@@ -202,6 +256,7 @@ private fun <T> Looked(lookup: Lookup<T>, exit: ExitTransition, content: @Compos
}
private val StatShape = RoundedCornerShape(12.dp)
private val CapsuleStatShape = RoundedCornerShape(99.dp)
private val LinkShape = RoundedCornerShape(10.dp)
private val BadgeHeight = 32.dp
@@ -360,8 +360,10 @@ private fun DownloadCard(d: DownloadEntry, s: FrontEndState, a: FrontEndActions)
Row(horizontalArrangement = Arrangement.spacedBy(8.dp), verticalAlignment = Alignment.CenterVertically) {
when (d.state) {
DownloadState.RUNNING, DownloadState.QUEUED -> {
RoundAction(Icons.Filled.Pause, stringResource(R.string.stores_dl_pause)) { DownloadQueue.pause(d.key) }
CancelAction { DownloadQueue.cancel(ctx, d.key) }
if (d.interruptible) {
RoundAction(Icons.Filled.Pause, stringResource(R.string.stores_dl_pause)) { DownloadQueue.pause(d.key) }
CancelAction { DownloadQueue.cancel(ctx, d.key) }
}
}
DownloadState.PAUSED -> {
RoundAction(Icons.Filled.PlayArrow, stringResource(R.string.stores_dl_resume), primary = true) { DownloadQueue.resume(ctx, d.key) }
@@ -349,6 +349,7 @@ internal fun StoresPage(s: FrontEndState, a: FrontEndActions, modifier: Modifier
},
onDetailFocus = { detailFocused = it },
modifier = Modifier.fillMaxWidth().weight(1f).onSizeChanged { viewportH = with(density) { it.height.toDp() } },
bleedHorizontal = padH,
wrap = { key, content -> StoreTheme(Store.byId(key.substringBefore(':')) ?: store) { content() } },
grid = {
AnimatedContent(
@@ -881,7 +882,7 @@ private fun Storefront(
val visibleTarget = grid.layoutInfo.visibleItemsInfo.any { it.index == targetIndex }
if (!visibleTarget || (focus.attached[target] ?: 0) == 0 ||
runCatching { focus.items.getValue(target).requestFocus() }.isFailure) scope.launch {
grid.scrollToItem(targetIndex)
launch { grid.revealRow(headerItems + index, targetIndex, direction, with(density) { 10.dp.toPx() }) }
focusWithinFrames({ focus.last == target }) { focus.items[target] ?: androidx.compose.ui.focus.FocusRequester.Default }
}
}
@@ -1058,7 +1059,7 @@ internal fun SectionLabel(title: String) {
internal fun ModeHeader(
title: String, query: String, onQuery: (String) -> Unit, placeholder: String,
clearSearchFocus: Boolean = false,
lead: (@Composable () -> Unit)? = null, trailing: @Composable () -> Unit,
lead: (@Composable () -> Unit)? = null, inlineWhenStacked: Boolean = false, trailing: @Composable () -> Unit,
) {
val colors = MaterialTheme.colorScheme
val pal = LocalPalette.current
@@ -1100,8 +1101,23 @@ internal fun ModeHeader(
}
BoxWithConstraints(Modifier.fillMaxWidth()) {
val stacked = maxWidth < NarrowPaneWidth
val inline = stacked && inlineWhenStacked && maxWidth >= 440.dp
Column(Modifier.fillMaxWidth()) {
if (stacked) {
if (inline && !(searching || open > 0.01f)) Row(
verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp),
modifier = Modifier.fillMaxWidth().heightIn(min = 52.dp).padding(vertical = 4.dp),
) {
heading()
Box(Modifier.weight(1f), contentAlignment = Alignment.CenterEnd) {
Row(
verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp),
modifier = Modifier.horizontalScroll(rememberScrollState()),
) {
searchButton()
trailing()
}
}
} else if (stacked) {
Box(Modifier.padding(vertical = 4.dp)) { heading() }
Row(
verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp),
@@ -1380,6 +1396,9 @@ private fun CardMarker(item: CatalogItem, installed: Boolean, download: com.droi
val pal = LocalPalette.current
val small = 10.sp
when {
item.store == Store.GOG && download != null -> Text("${download.percent}%", fontSize = small, fontWeight = FontWeight.Bold, color = pal.signal, maxLines = 1)
item.store == Store.GOG && installed && com.droiddeck.launcher.stores.gog.GogMaintenance.checks[item.id]?.state == com.droiddeck.launcher.stores.gog.GogMaintenance.State.AVAILABLE ->
Text(stringResource(R.string.common_update), fontSize = small, fontWeight = FontWeight.Bold, color = pal.signal, maxLines = 1)
installed -> Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(3.dp)) {
val ctx = LocalContext.current
val game = StoresState.installedGame(item.store, item.id)
+59
View File
@@ -615,6 +615,65 @@
<string name="drawer_hud_color_amber">كهرماني</string>
<string name="drawer_hud_color_violet">بنفسجي</string>
<string name="drawer_hud_opacity">العتامة</string>
<string name="hud_matches_steam_overlay">يأتي معدل الإطارات وأزمنة الإطارات والقراءات من المصادر نفسها التي تستخدمها طبقة الأداء في Steam.</string>
<string name="hud_size">الحجم</string>
<string name="hud_size_hint">النقر على HUD يغيّر حجمه أيضًا.</string>
<string name="hud_size_full">كامل</string>
<string name="hud_size_tiles">مربعات</string>
<string name="hud_size_pill">كبسولة</string>
<string name="hud_size_minimal">مصغّر</string>
<string name="hud_size_mega">ضخم</string>
<string name="hud_locked">تثبيت في مكانه</string>
<string name="hud_locked_hint">اسحب HUD لتحريكه؛ والضغط مطولًا يثبّته أو يلغي تثبيته.</string>
<string name="hud_group_look">المظهر</string>
<string name="hud_scale">الحجم على الشاشة</string>
<string name="hud_color_soft">هادئ</string>
<string name="hud_color_mid">متوسط</string>
<string name="hud_color_vivid">زاهٍ</string>
<string name="hud_outline">الحد الخارجي</string>
<string name="hud_outline_color">لون الحد الخارجي</string>
<string name="hud_outline_gray">رمادي</string>
<string name="hud_outline_theme">لون المظهر</string>
<string name="hud_group_metrics">القراءات</string>
<string name="hud_metric_graph">مخطط زمن الإطار</string>
<string name="hud_metric_decimal">معدل الإطارات بخانة عشرية</string>
<string name="hud_metric_low001">أدنى 0.01%</string>
<string name="hud_metric_engine">محرك الرسومات</string>
<string name="hud_metric_gpu_model">اسم GPU</string>
<string name="hud_metric_gpu">حمل GPU</string>
<string name="hud_metric_gpu_temp">درجة حرارة GPU</string>
<string name="hud_metric_cpu">حمل CPU</string>
<string name="hud_metric_per_core">CPU لكل نواة</string>
<string name="hud_metric_temp">درجات الحرارة</string>
<string name="hud_metric_ram">الذاكرة</string>
<string name="hud_metric_vram">ذاكرة الرسومات</string>
<string name="hud_metric_swap">ذاكرة التبديل</string>
<string name="hud_metric_battery">مستوى البطارية</string>
<string name="hud_metric_power">استهلاك الطاقة</string>
<string name="hud_metric_network">الشبكة</string>
<string name="hud_metric_resolution">الدقة</string>
<string name="hud_metric_proton">إصدار Proton</string>
<string name="hud_metric_session">مدة الجلسة</string>
<string name="hud_metric_clock">الساعة</string>
<string name="hud_group_temps">درجات الحرارة</string>
<string name="hud_temp_unit">الوحدة</string>
<string name="hud_temp_bands">ألوان التحذير</string>
<string name="hud_temp_bands_hint">تتحول درجات الحرارة إلى الكهرماني ثم الأحمر كلما اقتربت من الحد.</string>
<string name="hud_temp_bands_off">إيقاف</string>
<string name="hud_temp_bands_auto">تلقائي</string>
<string name="hud_temp_bands_manual">يدوي</string>
<string name="hud_temp_red_cpu">CPU بالأحمر عند</string>
<string name="hud_temp_red_gpu">GPU بالأحمر عند</string>
<string name="hud_temp_red_battery">البطارية بالأحمر عند</string>
<string name="hud_group_more">المزيد</string>
<string name="hud_export">تشخيص HUD</string>
<string name="hud_export_hint">يحفظ تقريرًا عن كل مستشعر يقرؤه HUD في Downloads/DroidDeck.</string>
<string name="hud_export_button">حفظ</string>
<string name="hud_export_done">تم الحفظ في %1$s</string>
<string name="hud_export_failed">تعذّر حفظ تقرير HUD.</string>
<string name="hud_reset">إعادة ضبط إعدادات HUD</string>
<string name="hud_reset_button">إعادة ضبط</string>
<string name="hud_credit">FusionHUD من The412Banner، github.com/The412Banner/FusionHUD (GPL-3.0).</string>
<string name="drawer_scaling">وضع التحجيم</string>
<string name="drawer_scaling_sharpness">حدة التحجيم</string>
<string name="drawer_effects">مؤثرات الشاشة</string>
@@ -602,6 +602,65 @@
<string name="drawer_hud_color_amber">Ámbar</string>
<string name="drawer_hud_color_violet">Violeta</string>
<string name="drawer_hud_opacity">Opacidad</string>
<string name="hud_matches_steam_overlay">La tasa de fotogramas, los tiempos de fotograma y las lecturas provienen de las mismas fuentes que la superposición de rendimiento de Steam.</string>
<string name="hud_size">Tamaño</string>
<string name="hud_size_hint">Tocar el HUD también cambia su tamaño.</string>
<string name="hud_size_full">Completo</string>
<string name="hud_size_tiles">Mosaicos</string>
<string name="hud_size_pill">Píldora</string>
<string name="hud_size_minimal">Mínimo</string>
<string name="hud_size_mega">Mega</string>
<string name="hud_locked">Fijar posición</string>
<string name="hud_locked_hint">Arrastra el HUD para moverlo; una pulsación larga lo bloquea o lo desbloquea.</string>
<string name="hud_group_look">Aspecto</string>
<string name="hud_scale">Tamaño en pantalla</string>
<string name="hud_color_soft">Suave</string>
<string name="hud_color_mid">Medio</string>
<string name="hud_color_vivid">Intenso</string>
<string name="hud_outline">Contorno</string>
<string name="hud_outline_color">Color del contorno</string>
<string name="hud_outline_gray">Gris</string>
<string name="hud_outline_theme">Color del tema</string>
<string name="hud_group_metrics">Lecturas</string>
<string name="hud_metric_graph">Gráfico de tiempos de fotograma</string>
<string name="hud_metric_decimal">Tasa de fotogramas con decimal</string>
<string name="hud_metric_low001">0.01% más bajo</string>
<string name="hud_metric_engine">Motor gráfico</string>
<string name="hud_metric_gpu_model">Nombre de la GPU</string>
<string name="hud_metric_gpu">Carga de la GPU</string>
<string name="hud_metric_gpu_temp">Temperatura de la GPU</string>
<string name="hud_metric_cpu">Carga de la CPU</string>
<string name="hud_metric_per_core">CPU por núcleo</string>
<string name="hud_metric_temp">Temperaturas</string>
<string name="hud_metric_ram">Memoria</string>
<string name="hud_metric_vram">Memoria gráfica</string>
<string name="hud_metric_swap">Memoria de intercambio</string>
<string name="hud_metric_battery">Nivel de batería</string>
<string name="hud_metric_power">Consumo de energía</string>
<string name="hud_metric_network">Red</string>
<string name="hud_metric_resolution">Resolución</string>
<string name="hud_metric_proton">Versión de Proton</string>
<string name="hud_metric_session">Tiempo de sesión</string>
<string name="hud_metric_clock">Reloj</string>
<string name="hud_group_temps">Temperaturas</string>
<string name="hud_temp_unit">Unidad</string>
<string name="hud_temp_bands">Colores de aviso</string>
<string name="hud_temp_bands_hint">Las temperaturas se vuelven ámbar y luego rojas al acercarse al límite.</string>
<string name="hud_temp_bands_off">Desactivado</string>
<string name="hud_temp_bands_auto">Automático</string>
<string name="hud_temp_bands_manual">Manual</string>
<string name="hud_temp_red_cpu">CPU en rojo a partir de</string>
<string name="hud_temp_red_gpu">GPU en rojo a partir de</string>
<string name="hud_temp_red_battery">Batería en rojo a partir de</string>
<string name="hud_group_more">Más</string>
<string name="hud_export">Diagnóstico del HUD</string>
<string name="hud_export_hint">Guarda en Downloads/DroidDeck un informe de cada sensor que lee el HUD.</string>
<string name="hud_export_button">Guardar</string>
<string name="hud_export_done">Guardado en %1$s</string>
<string name="hud_export_failed">No se pudo guardar el informe del HUD.</string>
<string name="hud_reset">Restablecer ajustes del HUD</string>
<string name="hud_reset_button">Restablecer</string>
<string name="hud_credit">FusionHUD de The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
<string name="drawer_scaling">Modo de escalado</string>
<string name="drawer_scaling_sharpness">Nitidez del escalado</string>
<string name="drawer_effects">Efectos de pantalla</string>
+59
View File
@@ -607,6 +607,65 @@
<string name="drawer_hud_color_amber">Кехлибарено</string>
<string name="drawer_hud_color_violet">Виолетово</string>
<string name="drawer_hud_opacity">Прозрачност</string>
<string name="hud_matches_steam_overlay">Честотата на кадрите, времената на кадрите и показанията идват от същите източници като наслагването за производителност на Steam.</string>
<string name="hud_size">Размер</string>
<string name="hud_size_hint">Докосването на HUD също променя размера му.</string>
<string name="hud_size_full">Пълен</string>
<string name="hud_size_tiles">Плочки</string>
<string name="hud_size_pill">Хапче</string>
<string name="hud_size_minimal">Минимален</string>
<string name="hud_size_mega">Мега</string>
<string name="hud_locked">Заключване на място</string>
<string name="hud_locked_hint">Плъзнете HUD, за да го преместите; продължително натискане го заключва или отключва.</string>
<string name="hud_group_look">Визия</string>
<string name="hud_scale">Размер на екрана</string>
<string name="hud_color_soft">Мек</string>
<string name="hud_color_mid">Среден</string>
<string name="hud_color_vivid">Наситен</string>
<string name="hud_outline">Контур</string>
<string name="hud_outline_color">Цвят на контура</string>
<string name="hud_outline_gray">Сив</string>
<string name="hud_outline_theme">Цвят на темата</string>
<string name="hud_group_metrics">Показания</string>
<string name="hud_metric_graph">Графика на времето на кадрите</string>
<string name="hud_metric_decimal">Честота на кадрите с десетичен знак</string>
<string name="hud_metric_low001">0.01% най-ниски</string>
<string name="hud_metric_engine">Графичен двигател</string>
<string name="hud_metric_gpu_model">Име на GPU</string>
<string name="hud_metric_gpu">Натоварване на GPU</string>
<string name="hud_metric_gpu_temp">Температура на GPU</string>
<string name="hud_metric_cpu">Натоварване на CPU</string>
<string name="hud_metric_per_core">CPU по ядра</string>
<string name="hud_metric_temp">Температури</string>
<string name="hud_metric_ram">Памет</string>
<string name="hud_metric_vram">Графична памет</string>
<string name="hud_metric_swap">Swap памет</string>
<string name="hud_metric_battery">Ниво на батерията</string>
<string name="hud_metric_power">Консумация на енергия</string>
<string name="hud_metric_network">Мрежа</string>
<string name="hud_metric_resolution">Разделителна способност</string>
<string name="hud_metric_proton">Версия на Proton</string>
<string name="hud_metric_session">Продължителност на сесията</string>
<string name="hud_metric_clock">Часовник</string>
<string name="hud_group_temps">Температури</string>
<string name="hud_temp_unit">Мерна единица</string>
<string name="hud_temp_bands">Предупредителни цветове</string>
<string name="hud_temp_bands_hint">Температурите стават кехлибарени, а после червени, когато наближат границата.</string>
<string name="hud_temp_bands_off">Изкл.</string>
<string name="hud_temp_bands_auto">Автоматично</string>
<string name="hud_temp_bands_manual">Ръчно</string>
<string name="hud_temp_red_cpu">CPU в червено от</string>
<string name="hud_temp_red_gpu">GPU в червено от</string>
<string name="hud_temp_red_battery">Батерия в червено от</string>
<string name="hud_group_more">Повече</string>
<string name="hud_export">Диагностика на HUD</string>
<string name="hud_export_hint">Записва в Downloads/DroidDeck отчет за всеки сензор, който HUD чете.</string>
<string name="hud_export_button">Запиши</string>
<string name="hud_export_done">Записано в %1$s</string>
<string name="hud_export_failed">Отчетът за HUD не можа да бъде записан.</string>
<string name="hud_reset">Нулиране на настройките на HUD</string>
<string name="hud_reset_button">Нулиране</string>
<string name="hud_credit">FusionHUD от The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
<string name="drawer_scaling">Режим на мащабиране</string>
<string name="drawer_scaling_sharpness">Острота на мащабиране</string>
<string name="drawer_effects">Ефекти на екрана</string>
+59
View File
@@ -611,6 +611,65 @@
<string name="drawer_hud_color_amber">Ambrová</string>
<string name="drawer_hud_color_violet">Fialová</string>
<string name="drawer_hud_opacity">Průhlednost</string>
<string name="hud_matches_steam_overlay">Snímková frekvence, časy snímků a naměřené hodnoty pocházejí ze stejných zdrojů jako výkonnostní překryv Steamu.</string>
<string name="hud_size">Velikost</string>
<string name="hud_size_hint">Klepnutím na HUD se také změní jeho velikost.</string>
<string name="hud_size_full">Plný</string>
<string name="hud_size_tiles">Dlaždice</string>
<string name="hud_size_pill">Pilulka</string>
<string name="hud_size_minimal">Minimální</string>
<string name="hud_size_mega">Mega</string>
<string name="hud_locked">Zamknout na místě</string>
<string name="hud_locked_hint">Přetažením HUD přesunete; dlouhým stiskem ho zamknete nebo odemknete.</string>
<string name="hud_group_look">Vzhled</string>
<string name="hud_scale">Velikost na obrazovce</string>
<string name="hud_color_soft">Jemná</string>
<string name="hud_color_mid">Střední</string>
<string name="hud_color_vivid">Sytá</string>
<string name="hud_outline">Obrys</string>
<string name="hud_outline_color">Barva obrysu</string>
<string name="hud_outline_gray">Šedá</string>
<string name="hud_outline_theme">Barva tématu</string>
<string name="hud_group_metrics">Údaje</string>
<string name="hud_metric_graph">Graf časů snímků</string>
<string name="hud_metric_decimal">Snímková frekvence s desetinným místem</string>
<string name="hud_metric_low001">0.01% nejnižší</string>
<string name="hud_metric_engine">Grafický engine</string>
<string name="hud_metric_gpu_model">Název GPU</string>
<string name="hud_metric_gpu">Vytížení GPU</string>
<string name="hud_metric_gpu_temp">Teplota GPU</string>
<string name="hud_metric_cpu">Vytížení CPU</string>
<string name="hud_metric_per_core">CPU po jádrech</string>
<string name="hud_metric_temp">Teploty</string>
<string name="hud_metric_ram">Paměť</string>
<string name="hud_metric_vram">Grafická paměť</string>
<string name="hud_metric_swap">Odkládací paměť</string>
<string name="hud_metric_battery">Stav baterie</string>
<string name="hud_metric_power">Příkon</string>
<string name="hud_metric_network">Síť</string>
<string name="hud_metric_resolution">Rozlišení</string>
<string name="hud_metric_proton">Verze Protonu</string>
<string name="hud_metric_session">Doba relace</string>
<string name="hud_metric_clock">Hodiny</string>
<string name="hud_group_temps">Teploty</string>
<string name="hud_temp_unit">Jednotka</string>
<string name="hud_temp_bands">Varovné barvy</string>
<string name="hud_temp_bands_hint">Teploty se při přiblížení k limitu zbarví nejprve ambrově, pak červeně.</string>
<string name="hud_temp_bands_off">Vypnuto</string>
<string name="hud_temp_bands_auto">Automaticky</string>
<string name="hud_temp_bands_manual">Manuální</string>
<string name="hud_temp_red_cpu">CPU červeně od</string>
<string name="hud_temp_red_gpu">GPU červeně od</string>
<string name="hud_temp_red_battery">Baterie červeně od</string>
<string name="hud_group_more">Více</string>
<string name="hud_export">Diagnostika HUD</string>
<string name="hud_export_hint">Uloží do Downloads/DroidDeck zprávu o všech senzorech, které HUD čte.</string>
<string name="hud_export_button">Uložit</string>
<string name="hud_export_done">Uloženo do %1$s</string>
<string name="hud_export_failed">Zprávu HUD se nepodařilo uložit.</string>
<string name="hud_reset">Obnovit nastavení HUD</string>
<string name="hud_reset_button">Obnovit</string>
<string name="hud_credit">FusionHUD od The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
<string name="drawer_scaling">Režim škálování</string>
<string name="drawer_scaling_sharpness">Ostrost škálování</string>
<string name="drawer_effects">Efekty obrazovky</string>
+59
View File
@@ -607,6 +607,65 @@
<string name="drawer_hud_color_amber">Ravgul</string>
<string name="drawer_hud_color_violet">Violet</string>
<string name="drawer_hud_opacity">Gennemsigtighed</string>
<string name="hud_matches_steam_overlay">Billedhastighed, billedtider og målinger kommer fra de samme kilder som Steams ydelsesoverlay.</string>
<string name="hud_size">Størrelse</string>
<string name="hud_size_hint">Et tryk på HUD ændrer også størrelsen.</string>
<string name="hud_size_full">Fuld</string>
<string name="hud_size_tiles">Fliser</string>
<string name="hud_size_pill">Pille</string>
<string name="hud_size_minimal">Minimal</string>
<string name="hud_size_mega">Mega</string>
<string name="hud_locked">Lås fast</string>
<string name="hud_locked_hint">Træk i HUD for at flytte det; et langt tryk låser eller frigør det.</string>
<string name="hud_group_look">Udseende</string>
<string name="hud_scale">Størrelse på skærmen</string>
<string name="hud_color_soft">Blød</string>
<string name="hud_color_mid">Mellem</string>
<string name="hud_color_vivid">Kraftig</string>
<string name="hud_outline">Kontur</string>
<string name="hud_outline_color">Konturfarve</string>
<string name="hud_outline_gray">Grå</string>
<string name="hud_outline_theme">Temafarve</string>
<string name="hud_group_metrics">Målinger</string>
<string name="hud_metric_graph">Billedtidsgraf</string>
<string name="hud_metric_decimal">Billedhastighed med decimal</string>
<string name="hud_metric_low001">0.01% laveste</string>
<string name="hud_metric_engine">Grafikmotor</string>
<string name="hud_metric_gpu_model">GPU-navn</string>
<string name="hud_metric_gpu">GPU-belastning</string>
<string name="hud_metric_gpu_temp">GPU-temperatur</string>
<string name="hud_metric_cpu">CPU-belastning</string>
<string name="hud_metric_per_core">CPU pr. kerne</string>
<string name="hud_metric_temp">Temperaturer</string>
<string name="hud_metric_ram">Hukommelse</string>
<string name="hud_metric_vram">Grafikhukommelse</string>
<string name="hud_metric_swap">Swap-hukommelse</string>
<string name="hud_metric_battery">Batteriniveau</string>
<string name="hud_metric_power">Strømforbrug</string>
<string name="hud_metric_network">Netværk</string>
<string name="hud_metric_resolution">Opløsning</string>
<string name="hud_metric_proton">Proton-version</string>
<string name="hud_metric_session">Sessionstid</string>
<string name="hud_metric_clock">Ur</string>
<string name="hud_group_temps">Temperaturer</string>
<string name="hud_temp_unit">Enhed</string>
<string name="hud_temp_bands">Advarselsfarver</string>
<string name="hud_temp_bands_hint">Temperaturer bliver ravgule og derefter røde, når de nærmer sig grænsen.</string>
<string name="hud_temp_bands_off">Fra</string>
<string name="hud_temp_bands_auto">Automatisk</string>
<string name="hud_temp_bands_manual">Manuel</string>
<string name="hud_temp_red_cpu">CPU rød ved</string>
<string name="hud_temp_red_gpu">GPU rød ved</string>
<string name="hud_temp_red_battery">Batteri rødt ved</string>
<string name="hud_group_more">Mere</string>
<string name="hud_export">HUD-diagnostik</string>
<string name="hud_export_hint">Gemmer en rapport over alle sensorer, som HUD læser, i Downloads/DroidDeck.</string>
<string name="hud_export_button">Gem</string>
<string name="hud_export_done">Gemt i %1$s</string>
<string name="hud_export_failed">HUD-rapporten kunne ikke gemmes.</string>
<string name="hud_reset">Nulstil HUD-indstillinger</string>
<string name="hud_reset_button">Nulstil</string>
<string name="hud_credit">FusionHUD af The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
<string name="drawer_scaling">Skaleringstilstand</string>
<string name="drawer_scaling_sharpness">Skaleringsskarphed</string>
<string name="drawer_effects">Skærmeffekter</string>
+59
View File
@@ -607,6 +607,65 @@
<string name="drawer_hud_color_amber">Bernstein</string>
<string name="drawer_hud_color_violet">Violett</string>
<string name="drawer_hud_opacity">Deckkraft</string>
<string name="hud_matches_steam_overlay">Bildrate, Frametimes und Messwerte stammen aus denselben Quellen wie das Leistungs-Overlay von Steam.</string>
<string name="hud_size">Größe</string>
<string name="hud_size_hint">Tippen auf das HUD ändert auch seine Größe.</string>
<string name="hud_size_full">Voll</string>
<string name="hud_size_tiles">Kacheln</string>
<string name="hud_size_pill">Kapsel</string>
<string name="hud_size_minimal">Minimal</string>
<string name="hud_size_mega">Mega</string>
<string name="hud_locked">Position sperren</string>
<string name="hud_locked_hint">Ziehe das HUD, um es zu verschieben; langes Drücken sperrt oder entsperrt es.</string>
<string name="hud_group_look">Aussehen</string>
<string name="hud_scale">Größe auf dem Bildschirm</string>
<string name="hud_color_soft">Dezent</string>
<string name="hud_color_mid">Mittel</string>
<string name="hud_color_vivid">Kräftig</string>
<string name="hud_outline">Kontur</string>
<string name="hud_outline_color">Konturfarbe</string>
<string name="hud_outline_gray">Grau</string>
<string name="hud_outline_theme">Designfarbe</string>
<string name="hud_group_metrics">Messwerte</string>
<string name="hud_metric_graph">Frametime-Diagramm</string>
<string name="hud_metric_decimal">Bildrate mit Nachkommastelle</string>
<string name="hud_metric_low001">0.01%-Tiefstwert</string>
<string name="hud_metric_engine">Grafik-Engine</string>
<string name="hud_metric_gpu_model">GPU-Name</string>
<string name="hud_metric_gpu">GPU-Auslastung</string>
<string name="hud_metric_gpu_temp">GPU-Temperatur</string>
<string name="hud_metric_cpu">CPU-Auslastung</string>
<string name="hud_metric_per_core">CPU pro Kern</string>
<string name="hud_metric_temp">Temperaturen</string>
<string name="hud_metric_ram">Arbeitsspeicher</string>
<string name="hud_metric_vram">Grafikspeicher</string>
<string name="hud_metric_swap">Swap-Speicher</string>
<string name="hud_metric_battery">Akkustand</string>
<string name="hud_metric_power">Leistungsaufnahme</string>
<string name="hud_metric_network">Netzwerk</string>
<string name="hud_metric_resolution">Auflösung</string>
<string name="hud_metric_proton">Proton-Version</string>
<string name="hud_metric_session">Sitzungsdauer</string>
<string name="hud_metric_clock">Uhrzeit</string>
<string name="hud_group_temps">Temperaturen</string>
<string name="hud_temp_unit">Einheit</string>
<string name="hud_temp_bands">Warnfarben</string>
<string name="hud_temp_bands_hint">Temperaturen werden erst bernsteinfarben, dann rot, wenn sie sich dem Grenzwert nähern.</string>
<string name="hud_temp_bands_off">Aus</string>
<string name="hud_temp_bands_auto">Automatisch</string>
<string name="hud_temp_bands_manual">Manuell</string>
<string name="hud_temp_red_cpu">CPU rot ab</string>
<string name="hud_temp_red_gpu">GPU rot ab</string>
<string name="hud_temp_red_battery">Akku rot ab</string>
<string name="hud_group_more">Mehr</string>
<string name="hud_export">HUD-Diagnose</string>
<string name="hud_export_hint">Speichert einen Bericht zu allen Sensoren, die das HUD ausliest, unter Downloads/DroidDeck.</string>
<string name="hud_export_button">Speichern</string>
<string name="hud_export_done">Gespeichert unter %1$s</string>
<string name="hud_export_failed">Der HUD-Bericht konnte nicht gespeichert werden.</string>
<string name="hud_reset">HUD-Einstellungen zurücksetzen</string>
<string name="hud_reset_button">Zurücksetzen</string>
<string name="hud_credit">FusionHUD von The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
<string name="drawer_scaling">Skalierungsmodus</string>
<string name="drawer_scaling_sharpness">Skalierungsschärfe</string>
<string name="drawer_effects">Bildschirmeffekte</string>
+59
View File
@@ -607,6 +607,65 @@
<string name="drawer_hud_color_amber">Κεχριμπαρί</string>
<string name="drawer_hud_color_violet">Βιολετί</string>
<string name="drawer_hud_opacity">Διαφάνεια</string>
<string name="hud_matches_steam_overlay">Ο ρυθμός καρέ, οι χρόνοι καρέ και οι μετρήσεις προέρχονται από τις ίδιες πηγές με την επικάλυψη απόδοσης του Steam.</string>
<string name="hud_size">Μέγεθος</string>
<string name="hud_size_hint">Το πάτημα στο HUD αλλάζει επίσης το μέγεθός του.</string>
<string name="hud_size_full">Πλήρες</string>
<string name="hud_size_tiles">Πλακίδια</string>
<string name="hud_size_pill">Κάψουλα</string>
<string name="hud_size_minimal">Ελάχιστο</string>
<string name="hud_size_mega">Μέγα</string>
<string name="hud_locked">Κλείδωμα θέσης</string>
<string name="hud_locked_hint">Σύρετε το HUD για να το μετακινήσετε· ένα παρατεταμένο πάτημα το κλειδώνει ή το ξεκλειδώνει.</string>
<string name="hud_group_look">Εμφάνιση</string>
<string name="hud_scale">Μέγεθος στην οθόνη</string>
<string name="hud_color_soft">Απαλό</string>
<string name="hud_color_mid">Μεσαίο</string>
<string name="hud_color_vivid">Έντονο</string>
<string name="hud_outline">Περίγραμμα</string>
<string name="hud_outline_color">Χρώμα περιγράμματος</string>
<string name="hud_outline_gray">Γκρι</string>
<string name="hud_outline_theme">Χρώμα θέματος</string>
<string name="hud_group_metrics">Μετρήσεις</string>
<string name="hud_metric_graph">Γράφημα χρόνου καρέ</string>
<string name="hud_metric_decimal">Ρυθμός καρέ με δεκαδικό</string>
<string name="hud_metric_low001">0.01% χαμηλότερα</string>
<string name="hud_metric_engine">Μηχανή γραφικών</string>
<string name="hud_metric_gpu_model">Όνομα GPU</string>
<string name="hud_metric_gpu">Φόρτος GPU</string>
<string name="hud_metric_gpu_temp">Θερμοκρασία GPU</string>
<string name="hud_metric_cpu">Φόρτος CPU</string>
<string name="hud_metric_per_core">CPU ανά πυρήνα</string>
<string name="hud_metric_temp">Θερμοκρασίες</string>
<string name="hud_metric_ram">Μνήμη</string>
<string name="hud_metric_vram">Μνήμη γραφικών</string>
<string name="hud_metric_swap">Μνήμη swap</string>
<string name="hud_metric_battery">Στάθμη μπαταρίας</string>
<string name="hud_metric_power">Κατανάλωση ισχύος</string>
<string name="hud_metric_network">Δίκτυο</string>
<string name="hud_metric_resolution">Ανάλυση</string>
<string name="hud_metric_proton">Έκδοση Proton</string>
<string name="hud_metric_session">Χρόνος συνεδρίας</string>
<string name="hud_metric_clock">Ρολόι</string>
<string name="hud_group_temps">Θερμοκρασίες</string>
<string name="hud_temp_unit">Μονάδα</string>
<string name="hud_temp_bands">Χρώματα προειδοποίησης</string>
<string name="hud_temp_bands_hint">Οι θερμοκρασίες γίνονται κεχριμπαρί και μετά κόκκινες καθώς πλησιάζουν το όριο.</string>
<string name="hud_temp_bands_off">Ανενεργό</string>
<string name="hud_temp_bands_auto">Αυτόματο</string>
<string name="hud_temp_bands_manual">Μη αυτόματο</string>
<string name="hud_temp_red_cpu">CPU κόκκινο από</string>
<string name="hud_temp_red_gpu">GPU κόκκινο από</string>
<string name="hud_temp_red_battery">Μπαταρία κόκκινο από</string>
<string name="hud_group_more">Περισσότερα</string>
<string name="hud_export">Διαγνωστικά HUD</string>
<string name="hud_export_hint">Αποθηκεύει στο Downloads/DroidDeck μια αναφορά για κάθε αισθητήρα που διαβάζει το HUD.</string>
<string name="hud_export_button">Αποθήκευση</string>
<string name="hud_export_done">Αποθηκεύτηκε στο %1$s</string>
<string name="hud_export_failed">Δεν ήταν δυνατή η αποθήκευση της αναφοράς HUD.</string>
<string name="hud_reset">Επαναφορά ρυθμίσεων HUD</string>
<string name="hud_reset_button">Επαναφορά</string>
<string name="hud_credit">FusionHUD από The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
<string name="drawer_scaling">Λειτουργία κλιμάκωσης</string>
<string name="drawer_scaling_sharpness">Οξύτητα κλιμάκωσης</string>
<string name="drawer_effects">Εφέ οθόνης</string>
+59
View File
@@ -611,6 +611,65 @@
<string name="drawer_hud_color_amber">Ámbar</string>
<string name="drawer_hud_color_violet">Violeta</string>
<string name="drawer_hud_opacity">Opacidad</string>
<string name="hud_matches_steam_overlay">La tasa de fotogramas, los tiempos de fotograma y las lecturas provienen de las mismas fuentes que la superposición de rendimiento de Steam.</string>
<string name="hud_size">Tamaño</string>
<string name="hud_size_hint">Tocar el HUD también cambia su tamaño.</string>
<string name="hud_size_full">Completo</string>
<string name="hud_size_tiles">Mosaicos</string>
<string name="hud_size_pill">Píldora</string>
<string name="hud_size_minimal">Mínimo</string>
<string name="hud_size_mega">Mega</string>
<string name="hud_locked">Fijar posición</string>
<string name="hud_locked_hint">Arrastra el HUD para moverlo; una pulsación larga lo bloquea o lo desbloquea.</string>
<string name="hud_group_look">Aspecto</string>
<string name="hud_scale">Tamaño en pantalla</string>
<string name="hud_color_soft">Suave</string>
<string name="hud_color_mid">Medio</string>
<string name="hud_color_vivid">Intenso</string>
<string name="hud_outline">Contorno</string>
<string name="hud_outline_color">Color del contorno</string>
<string name="hud_outline_gray">Gris</string>
<string name="hud_outline_theme">Color del tema</string>
<string name="hud_group_metrics">Lecturas</string>
<string name="hud_metric_graph">Gráfico de tiempos de fotograma</string>
<string name="hud_metric_decimal">Tasa de fotogramas con decimal</string>
<string name="hud_metric_low001">0.01% más bajo</string>
<string name="hud_metric_engine">Motor gráfico</string>
<string name="hud_metric_gpu_model">Nombre de la GPU</string>
<string name="hud_metric_gpu">Carga de la GPU</string>
<string name="hud_metric_gpu_temp">Temperatura de la GPU</string>
<string name="hud_metric_cpu">Carga de la CPU</string>
<string name="hud_metric_per_core">CPU por núcleo</string>
<string name="hud_metric_temp">Temperaturas</string>
<string name="hud_metric_ram">Memoria</string>
<string name="hud_metric_vram">Memoria gráfica</string>
<string name="hud_metric_swap">Memoria de intercambio</string>
<string name="hud_metric_battery">Nivel de batería</string>
<string name="hud_metric_power">Consumo de energía</string>
<string name="hud_metric_network">Red</string>
<string name="hud_metric_resolution">Resolución</string>
<string name="hud_metric_proton">Versión de Proton</string>
<string name="hud_metric_session">Tiempo de sesión</string>
<string name="hud_metric_clock">Reloj</string>
<string name="hud_group_temps">Temperaturas</string>
<string name="hud_temp_unit">Unidad</string>
<string name="hud_temp_bands">Colores de aviso</string>
<string name="hud_temp_bands_hint">Las temperaturas se vuelven ámbar y luego rojas al acercarse al límite.</string>
<string name="hud_temp_bands_off">Desactivado</string>
<string name="hud_temp_bands_auto">Automático</string>
<string name="hud_temp_bands_manual">Manual</string>
<string name="hud_temp_red_cpu">CPU en rojo a partir de</string>
<string name="hud_temp_red_gpu">GPU en rojo a partir de</string>
<string name="hud_temp_red_battery">Batería en rojo a partir de</string>
<string name="hud_group_more">Más</string>
<string name="hud_export">Diagnóstico del HUD</string>
<string name="hud_export_hint">Guarda en Downloads/DroidDeck un informe de cada sensor que lee el HUD.</string>
<string name="hud_export_button">Guardar</string>
<string name="hud_export_done">Guardado en %1$s</string>
<string name="hud_export_failed">No se ha podido guardar el informe del HUD.</string>
<string name="hud_reset">Restablecer ajustes del HUD</string>
<string name="hud_reset_button">Restablecer</string>
<string name="hud_credit">FusionHUD de The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
<string name="drawer_scaling">Modo de escalado</string>
<string name="drawer_scaling_sharpness">Nitidez del escalado</string>
<string name="drawer_effects">Efectos de pantalla</string>
+59
View File
@@ -607,6 +607,65 @@
<string name="drawer_hud_color_amber">Meripihka</string>
<string name="drawer_hud_color_violet">Violetti</string>
<string name="drawer_hud_opacity">Peittävyys</string>
<string name="hud_matches_steam_overlay">Kuvataajuus, kuva-ajat ja lukemat tulevat samoista lähteistä kuin Steamin suorituskykynäkymässä.</string>
<string name="hud_size">Koko</string>
<string name="hud_size_hint">HUD:n napauttaminen muuttaa myös sen kokoa.</string>
<string name="hud_size_full">Täysi</string>
<string name="hud_size_tiles">Ruudut</string>
<string name="hud_size_pill">Kapseli</string>
<string name="hud_size_minimal">Minimaalinen</string>
<string name="hud_size_mega">Mega</string>
<string name="hud_locked">Lukitse paikalleen</string>
<string name="hud_locked_hint">Siirrä HUD:ia vetämällä; pitkä painallus lukitsee tai vapauttaa sen.</string>
<string name="hud_group_look">Ulkoasu</string>
<string name="hud_scale">Koko näytöllä</string>
<string name="hud_color_soft">Pehmeä</string>
<string name="hud_color_mid">Keskitaso</string>
<string name="hud_color_vivid">Kirkas</string>
<string name="hud_outline">Ääriviiva</string>
<string name="hud_outline_color">Ääriviivan väri</string>
<string name="hud_outline_gray">Harmaa</string>
<string name="hud_outline_theme">Teeman väri</string>
<string name="hud_group_metrics">Lukemat</string>
<string name="hud_metric_graph">Kuva-aikakäyrä</string>
<string name="hud_metric_decimal">Kuvataajuus desimaalilla</string>
<string name="hud_metric_low001">0.01% alin</string>
<string name="hud_metric_engine">Grafiikkamoottori</string>
<string name="hud_metric_gpu_model">GPU:n nimi</string>
<string name="hud_metric_gpu">GPU:n kuorma</string>
<string name="hud_metric_gpu_temp">GPU:n lämpötila</string>
<string name="hud_metric_cpu">CPU:n kuorma</string>
<string name="hud_metric_per_core">CPU ytimittäin</string>
<string name="hud_metric_temp">Lämpötilat</string>
<string name="hud_metric_ram">Muisti</string>
<string name="hud_metric_vram">Näytönohjaimen muisti</string>
<string name="hud_metric_swap">Swap-tila</string>
<string name="hud_metric_battery">Akun varaus</string>
<string name="hud_metric_power">Virrankulutus</string>
<string name="hud_metric_network">Verkko</string>
<string name="hud_metric_resolution">Tarkkuus</string>
<string name="hud_metric_proton">Proton-versio</string>
<string name="hud_metric_session">Istunnon kesto</string>
<string name="hud_metric_clock">Kello</string>
<string name="hud_group_temps">Lämpötilat</string>
<string name="hud_temp_unit">Yksikkö</string>
<string name="hud_temp_bands">Varoitusvärit</string>
<string name="hud_temp_bands_hint">Lämpötilat muuttuvat meripihkanvärisiksi ja sitten punaisiksi, kun ne lähestyvät rajaa.</string>
<string name="hud_temp_bands_off">Pois</string>
<string name="hud_temp_bands_auto">Automaattinen</string>
<string name="hud_temp_bands_manual">Manuaalinen</string>
<string name="hud_temp_red_cpu">CPU:n punainen raja</string>
<string name="hud_temp_red_gpu">GPU:n punainen raja</string>
<string name="hud_temp_red_battery">Akun punainen raja</string>
<string name="hud_group_more">Lisää</string>
<string name="hud_export">HUD-diagnostiikka</string>
<string name="hud_export_hint">Tallentaa raportin kaikista HUD:n lukemista antureista kansioon Downloads/DroidDeck.</string>
<string name="hud_export_button">Tallenna</string>
<string name="hud_export_done">Tallennettu: %1$s</string>
<string name="hud_export_failed">HUD-raporttia ei voitu tallentaa.</string>
<string name="hud_reset">Palauta HUD-asetukset</string>
<string name="hud_reset_button">Palauta</string>
<string name="hud_credit">FusionHUD, tekijä The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
<string name="drawer_scaling">Skaalaustila</string>
<string name="drawer_scaling_sharpness">Skaalauksen terävyys</string>
<string name="drawer_effects">Näyttötehosteet</string>
+59
View File
@@ -611,6 +611,65 @@
<string name="drawer_hud_color_amber">Ambre</string>
<string name="drawer_hud_color_violet">Violet</string>
<string name="drawer_hud_opacity">Opacité</string>
<string name="hud_matches_steam_overlay">La fréquence d\'images, les temps d\'image et les mesures proviennent des mêmes sources que la superposition de performances de Steam.</string>
<string name="hud_size">Taille</string>
<string name="hud_size_hint">Toucher le HUD change aussi sa taille.</string>
<string name="hud_size_full">Complet</string>
<string name="hud_size_tiles">Tuiles</string>
<string name="hud_size_pill">Pilule</string>
<string name="hud_size_minimal">Minimal</string>
<string name="hud_size_mega">Méga</string>
<string name="hud_locked">Verrouiller la position</string>
<string name="hud_locked_hint">Faites glisser le HUD pour le déplacer ; un appui long le verrouille ou le déverrouille.</string>
<string name="hud_group_look">Apparence</string>
<string name="hud_scale">Taille à l\'écran</string>
<string name="hud_color_soft">Douce</string>
<string name="hud_color_mid">Moyenne</string>
<string name="hud_color_vivid">Vive</string>
<string name="hud_outline">Contour</string>
<string name="hud_outline_color">Couleur du contour</string>
<string name="hud_outline_gray">Gris</string>
<string name="hud_outline_theme">Couleur du thème</string>
<string name="hud_group_metrics">Mesures</string>
<string name="hud_metric_graph">Graphique des temps d\'image</string>
<string name="hud_metric_decimal">Fréquence d\'images avec une décimale</string>
<string name="hud_metric_low001">0.01% les plus bas</string>
<string name="hud_metric_engine">Moteur graphique</string>
<string name="hud_metric_gpu_model">Nom du GPU</string>
<string name="hud_metric_gpu">Charge du GPU</string>
<string name="hud_metric_gpu_temp">Température du GPU</string>
<string name="hud_metric_cpu">Charge du CPU</string>
<string name="hud_metric_per_core">CPU par cœur</string>
<string name="hud_metric_temp">Températures</string>
<string name="hud_metric_ram">Mémoire</string>
<string name="hud_metric_vram">Mémoire graphique</string>
<string name="hud_metric_swap">Mémoire d\'échange</string>
<string name="hud_metric_battery">Niveau de batterie</string>
<string name="hud_metric_power">Consommation</string>
<string name="hud_metric_network">Réseau</string>
<string name="hud_metric_resolution">Résolution</string>
<string name="hud_metric_proton">Version de Proton</string>
<string name="hud_metric_session">Durée de session</string>
<string name="hud_metric_clock">Horloge</string>
<string name="hud_group_temps">Températures</string>
<string name="hud_temp_unit">Unité</string>
<string name="hud_temp_bands">Couleurs d\'alerte</string>
<string name="hud_temp_bands_hint">Les températures passent à l\'ambre, puis au rouge, à l\'approche de la limite.</string>
<string name="hud_temp_bands_off">Désactivé</string>
<string name="hud_temp_bands_auto">Automatique</string>
<string name="hud_temp_bands_manual">Manuel</string>
<string name="hud_temp_red_cpu">CPU en rouge à</string>
<string name="hud_temp_red_gpu">GPU en rouge à</string>
<string name="hud_temp_red_battery">Batterie en rouge à</string>
<string name="hud_group_more">Plus</string>
<string name="hud_export">Diagnostic du HUD</string>
<string name="hud_export_hint">Enregistre dans Downloads/DroidDeck un rapport sur chaque capteur lu par le HUD.</string>
<string name="hud_export_button">Enregistrer</string>
<string name="hud_export_done">Enregistré dans %1$s</string>
<string name="hud_export_failed">Impossible d\'enregistrer le rapport du HUD.</string>
<string name="hud_reset">Réinitialiser les paramètres du HUD</string>
<string name="hud_reset_button">Réinitialiser</string>
<string name="hud_credit">FusionHUD par The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
<string name="drawer_scaling">Mode de mise à l\'échelle</string>
<string name="drawer_scaling_sharpness">Netteté de la mise à l\'échelle</string>
<string name="drawer_effects">Effets d\'écran</string>
+59
View File
@@ -607,6 +607,65 @@
<string name="drawer_hud_color_amber">एम्बर</string>
<string name="drawer_hud_color_violet">वायलेट</string>
<string name="drawer_hud_opacity">ओपैसिटी</string>
<string name="hud_matches_steam_overlay">फ़्रेम दर, फ़्रेम टाइम और रीडिंग उन्हीं स्रोतों से आती हैं जिनसे Steam का परफ़ॉर्मेंस ओवरले उन्हें लेता है।</string>
<string name="hud_size">आकार</string>
<string name="hud_size_hint">HUD पर टैप करने से भी उसका आकार बदलता है।</string>
<string name="hud_size_full">फ़ुल</string>
<string name="hud_size_tiles">टाइल्स</string>
<string name="hud_size_pill">पिल</string>
<string name="hud_size_minimal">मिनिमल</string>
<string name="hud_size_mega">मेगा</string>
<string name="hud_locked">जगह पर लॉक करें</string>
<string name="hud_locked_hint">HUD को खिसकाने के लिए उसे ड्रैग करें; देर तक दबाने से वह लॉक या अनलॉक होता है।</string>
<string name="hud_group_look">लुक</string>
<string name="hud_scale">स्क्रीन पर आकार</string>
<string name="hud_color_soft">हल्का</string>
<string name="hud_color_mid">मध्यम</string>
<string name="hud_color_vivid">चटख</string>
<string name="hud_outline">आउटलाइन</string>
<string name="hud_outline_color">आउटलाइन का रंग</string>
<string name="hud_outline_gray">ग्रे</string>
<string name="hud_outline_theme">थीम का रंग</string>
<string name="hud_group_metrics">रीडिंग</string>
<string name="hud_metric_graph">फ़्रेम टाइम ग्राफ़</string>
<string name="hud_metric_decimal">दशमलव सहित फ़्रेम दर</string>
<string name="hud_metric_low001">0.01% लो</string>
<string name="hud_metric_engine">ग्राफ़िक्स इंजन</string>
<string name="hud_metric_gpu_model">GPU का नाम</string>
<string name="hud_metric_gpu">GPU लोड</string>
<string name="hud_metric_gpu_temp">GPU तापमान</string>
<string name="hud_metric_cpu">CPU लोड</string>
<string name="hud_metric_per_core">प्रति कोर CPU</string>
<string name="hud_metric_temp">तापमान</string>
<string name="hud_metric_ram">मेमोरी</string>
<string name="hud_metric_vram">ग्राफ़िक्स मेमोरी</string>
<string name="hud_metric_swap">स्वैप</string>
<string name="hud_metric_battery">बैटरी लेवल</string>
<string name="hud_metric_power">पावर खपत</string>
<string name="hud_metric_network">नेटवर्क</string>
<string name="hud_metric_resolution">रिज़ॉल्यूशन</string>
<string name="hud_metric_proton">Proton वर्शन</string>
<string name="hud_metric_session">सेशन का समय</string>
<string name="hud_metric_clock">घड़ी</string>
<string name="hud_group_temps">तापमान</string>
<string name="hud_temp_unit">इकाई</string>
<string name="hud_temp_bands">चेतावनी रंग</string>
<string name="hud_temp_bands_hint">सीमा के पास पहुंचने पर तापमान पहले एम्बर, फिर लाल हो जाता है।</string>
<string name="hud_temp_bands_off">बंद</string>
<string name="hud_temp_bands_auto">ऑटोमैटिक</string>
<string name="hud_temp_bands_manual">मैनुअल</string>
<string name="hud_temp_red_cpu">CPU लाल सीमा</string>
<string name="hud_temp_red_gpu">GPU लाल सीमा</string>
<string name="hud_temp_red_battery">बैटरी लाल सीमा</string>
<string name="hud_group_more">ज़्यादा</string>
<string name="hud_export">HUD डायग्नोस्टिक्स</string>
<string name="hud_export_hint">HUD जिन सेंसर को पढ़ता है, उन सबकी रिपोर्ट Downloads/DroidDeck में सेव करता है।</string>
<string name="hud_export_button">सेव करें</string>
<string name="hud_export_done">%1$s में सहेजा गया</string>
<string name="hud_export_failed">HUD रिपोर्ट सेव नहीं हो सकी।</string>
<string name="hud_reset">HUD सेटिंग रीसेट करें</string>
<string name="hud_reset_button">रीसेट करें</string>
<string name="hud_credit">The412Banner का FusionHUD, github.com/The412Banner/FusionHUD (GPL-3.0)।</string>
<string name="drawer_scaling">स्केलिंग मोड</string>
<string name="drawer_scaling_sharpness">स्केलिंग शार्पनेस</string>
<string name="drawer_effects">स्क्रीन इफ़ेक्ट</string>
+59
View File
@@ -607,6 +607,65 @@
<string name="drawer_hud_color_amber">Borostyán</string>
<string name="drawer_hud_color_violet">Lila</string>
<string name="drawer_hud_opacity">Átlátszatlanság</string>
<string name="hud_matches_steam_overlay">A képkockasebesség, a képkockaidők és a mért értékek ugyanazokból a forrásokból származnak, mint a Steam teljesítményátfedése.</string>
<string name="hud_size">Méret</string>
<string name="hud_size_hint">A HUD-ra koppintva is változik a mérete.</string>
<string name="hud_size_full">Teljes</string>
<string name="hud_size_tiles">Csempék</string>
<string name="hud_size_pill">Kapszula</string>
<string name="hud_size_minimal">Minimális</string>
<string name="hud_size_mega">Mega</string>
<string name="hud_locked">Rögzítés a helyén</string>
<string name="hud_locked_hint">Húzd a HUD-ot az áthelyezéshez; hosszú nyomással rögzítheted vagy feloldhatod.</string>
<string name="hud_group_look">Megjelenés</string>
<string name="hud_scale">Méret a képernyőn</string>
<string name="hud_color_soft">Lágy</string>
<string name="hud_color_mid">Közepes</string>
<string name="hud_color_vivid">Élénk</string>
<string name="hud_outline">Körvonal</string>
<string name="hud_outline_color">Körvonal színe</string>
<string name="hud_outline_gray">Szürke</string>
<string name="hud_outline_theme">Témaszín</string>
<string name="hud_group_metrics">Mért értékek</string>
<string name="hud_metric_graph">Képkockaidő-grafikon</string>
<string name="hud_metric_decimal">Képkockasebesség tizedesjeggyel</string>
<string name="hud_metric_low001">0.01% legalacsonyabb</string>
<string name="hud_metric_engine">Grafikus motor</string>
<string name="hud_metric_gpu_model">GPU neve</string>
<string name="hud_metric_gpu">GPU-terhelés</string>
<string name="hud_metric_gpu_temp">GPU-hőmérséklet</string>
<string name="hud_metric_cpu">CPU-terhelés</string>
<string name="hud_metric_per_core">CPU magonként</string>
<string name="hud_metric_temp">Hőmérsékletek</string>
<string name="hud_metric_ram">Memória</string>
<string name="hud_metric_vram">Grafikus memória</string>
<string name="hud_metric_swap">Swap-memória</string>
<string name="hud_metric_battery">Akkuszint</string>
<string name="hud_metric_power">Energiafelvétel</string>
<string name="hud_metric_network">Hálózat</string>
<string name="hud_metric_resolution">Felbontás</string>
<string name="hud_metric_proton">Proton-verzió</string>
<string name="hud_metric_session">Munkamenet ideje</string>
<string name="hud_metric_clock">Óra</string>
<string name="hud_group_temps">Hőmérsékletek</string>
<string name="hud_temp_unit">Mértékegység</string>
<string name="hud_temp_bands">Figyelmeztető színek</string>
<string name="hud_temp_bands_hint">A hőmérsékletek a határhoz közeledve előbb borostyánszínűre, majd pirosra váltanak.</string>
<string name="hud_temp_bands_off">Ki</string>
<string name="hud_temp_bands_auto">Automatikus</string>
<string name="hud_temp_bands_manual">Manuális</string>
<string name="hud_temp_red_cpu">CPU piros határa</string>
<string name="hud_temp_red_gpu">GPU piros határa</string>
<string name="hud_temp_red_battery">Akku piros határa</string>
<string name="hud_group_more">Több</string>
<string name="hud_export">HUD-diagnosztika</string>
<string name="hud_export_hint">Jelentést ment a HUD által olvasott összes érzékelőről a Downloads/DroidDeck mappába.</string>
<string name="hud_export_button">Mentés</string>
<string name="hud_export_done">Mentve: %1$s</string>
<string name="hud_export_failed">Nem sikerült menteni a HUD-jelentést.</string>
<string name="hud_reset">HUD-beállítások visszaállítása</string>
<string name="hud_reset_button">Visszaállítás</string>
<string name="hud_credit">FusionHUD, készítette: The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
<string name="drawer_scaling">Méretezési mód</string>
<string name="drawer_scaling_sharpness">Méretezési élesség</string>
<string name="drawer_effects">Képernyőeffektek</string>
+59
View File
@@ -605,6 +605,65 @@
<string name="drawer_hud_color_amber">Ambar</string>
<string name="drawer_hud_color_violet">Ungu</string>
<string name="drawer_hud_opacity">Opasitas</string>
<string name="hud_matches_steam_overlay">Laju bingkai, waktu bingkai, dan pembacaan berasal dari sumber yang sama dengan overlay performa Steam.</string>
<string name="hud_size">Ukuran</string>
<string name="hud_size_hint">Mengetuk HUD juga mengubah ukurannya.</string>
<string name="hud_size_full">Penuh</string>
<string name="hud_size_tiles">Ubin</string>
<string name="hud_size_pill">Pil</string>
<string name="hud_size_minimal">Minimal</string>
<string name="hud_size_mega">Mega</string>
<string name="hud_locked">Kunci posisi</string>
<string name="hud_locked_hint">Seret HUD untuk memindahkannya; tekan lama untuk mengunci atau membuka kuncinya.</string>
<string name="hud_group_look">Tampilan</string>
<string name="hud_scale">Ukuran di layar</string>
<string name="hud_color_soft">Lembut</string>
<string name="hud_color_mid">Sedang</string>
<string name="hud_color_vivid">Cerah</string>
<string name="hud_outline">Garis tepi</string>
<string name="hud_outline_color">Warna garis tepi</string>
<string name="hud_outline_gray">Abu-abu</string>
<string name="hud_outline_theme">Warna tema</string>
<string name="hud_group_metrics">Pembacaan</string>
<string name="hud_metric_graph">Grafik waktu bingkai</string>
<string name="hud_metric_decimal">Laju bingkai dengan desimal</string>
<string name="hud_metric_low001">0.01% terendah</string>
<string name="hud_metric_engine">Mesin grafis</string>
<string name="hud_metric_gpu_model">Nama GPU</string>
<string name="hud_metric_gpu">Beban GPU</string>
<string name="hud_metric_gpu_temp">Suhu GPU</string>
<string name="hud_metric_cpu">Beban CPU</string>
<string name="hud_metric_per_core">CPU per inti</string>
<string name="hud_metric_temp">Suhu</string>
<string name="hud_metric_ram">Memori</string>
<string name="hud_metric_vram">Memori grafis</string>
<string name="hud_metric_swap">Memori swap</string>
<string name="hud_metric_battery">Level baterai</string>
<string name="hud_metric_power">Konsumsi daya</string>
<string name="hud_metric_network">Jaringan</string>
<string name="hud_metric_resolution">Resolusi</string>
<string name="hud_metric_proton">Versi Proton</string>
<string name="hud_metric_session">Durasi sesi</string>
<string name="hud_metric_clock">Jam</string>
<string name="hud_group_temps">Suhu</string>
<string name="hud_temp_unit">Satuan</string>
<string name="hud_temp_bands">Warna peringatan</string>
<string name="hud_temp_bands_hint">Suhu berubah menjadi ambar, lalu merah, saat mendekati batas.</string>
<string name="hud_temp_bands_off">Nonaktif</string>
<string name="hud_temp_bands_auto">Otomatis</string>
<string name="hud_temp_bands_manual">Manual</string>
<string name="hud_temp_red_cpu">CPU merah pada</string>
<string name="hud_temp_red_gpu">GPU merah pada</string>
<string name="hud_temp_red_battery">Baterai merah pada</string>
<string name="hud_group_more">Lainnya</string>
<string name="hud_export">Diagnostik HUD</string>
<string name="hud_export_hint">Menyimpan laporan semua sensor yang dibaca HUD ke Downloads/DroidDeck.</string>
<string name="hud_export_button">Simpan</string>
<string name="hud_export_done">Disimpan di %1$s</string>
<string name="hud_export_failed">Tidak dapat menyimpan laporan HUD.</string>
<string name="hud_reset">Setel ulang setelan HUD</string>
<string name="hud_reset_button">Setel ulang</string>
<string name="hud_credit">FusionHUD oleh The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
<string name="drawer_scaling">Mode penskalaan</string>
<string name="drawer_scaling_sharpness">Ketajaman penskalaan</string>
<string name="drawer_effects">Efek layar</string>
+59
View File
@@ -609,6 +609,65 @@
<string name="drawer_hud_color_amber">Ambra</string>
<string name="drawer_hud_color_violet">Viola</string>
<string name="drawer_hud_opacity">Opacità</string>
<string name="hud_matches_steam_overlay">Frequenza fotogrammi, tempi dei fotogrammi e valori provengono dalle stesse fonti dell\'overlay prestazioni di Steam.</string>
<string name="hud_size">Dimensione</string>
<string name="hud_size_hint">Toccare l\'HUD ne cambia anche la dimensione.</string>
<string name="hud_size_full">Completo</string>
<string name="hud_size_tiles">Riquadri</string>
<string name="hud_size_pill">Pillola</string>
<string name="hud_size_minimal">Minimo</string>
<string name="hud_size_mega">Mega</string>
<string name="hud_locked">Blocca in posizione</string>
<string name="hud_locked_hint">Trascina l\'HUD per spostarlo; una pressione prolungata lo blocca o lo sblocca.</string>
<string name="hud_group_look">Aspetto</string>
<string name="hud_scale">Dimensione sullo schermo</string>
<string name="hud_color_soft">Tenue</string>
<string name="hud_color_mid">Medio</string>
<string name="hud_color_vivid">Vivace</string>
<string name="hud_outline">Contorno</string>
<string name="hud_outline_color">Colore contorno</string>
<string name="hud_outline_gray">Grigio</string>
<string name="hud_outline_theme">Colore del tema</string>
<string name="hud_group_metrics">Valori</string>
<string name="hud_metric_graph">Grafico tempi fotogramma</string>
<string name="hud_metric_decimal">Frequenza fotogrammi con decimale</string>
<string name="hud_metric_low001">0.01% più basso</string>
<string name="hud_metric_engine">Motore grafico</string>
<string name="hud_metric_gpu_model">Nome GPU</string>
<string name="hud_metric_gpu">Carico GPU</string>
<string name="hud_metric_gpu_temp">Temperatura GPU</string>
<string name="hud_metric_cpu">Carico CPU</string>
<string name="hud_metric_per_core">CPU per core</string>
<string name="hud_metric_temp">Temperature</string>
<string name="hud_metric_ram">Memoria</string>
<string name="hud_metric_vram">Memoria grafica</string>
<string name="hud_metric_swap">Memoria swap</string>
<string name="hud_metric_battery">Livello batteria</string>
<string name="hud_metric_power">Consumo energetico</string>
<string name="hud_metric_network">Rete</string>
<string name="hud_metric_resolution">Risoluzione</string>
<string name="hud_metric_proton">Versione Proton</string>
<string name="hud_metric_session">Durata sessione</string>
<string name="hud_metric_clock">Orologio</string>
<string name="hud_group_temps">Temperature</string>
<string name="hud_temp_unit">Unità</string>
<string name="hud_temp_bands">Colori di avviso</string>
<string name="hud_temp_bands_hint">Le temperature diventano ambra, poi rosse, man mano che si avvicinano al limite.</string>
<string name="hud_temp_bands_off">Disattivato</string>
<string name="hud_temp_bands_auto">Automatico</string>
<string name="hud_temp_bands_manual">Manuale</string>
<string name="hud_temp_red_cpu">CPU in rosso da</string>
<string name="hud_temp_red_gpu">GPU in rosso da</string>
<string name="hud_temp_red_battery">Batteria in rosso da</string>
<string name="hud_group_more">Altro</string>
<string name="hud_export">Diagnostica HUD</string>
<string name="hud_export_hint">Salva in Downloads/DroidDeck un rapporto su ogni sensore letto dall\'HUD.</string>
<string name="hud_export_button">Salva</string>
<string name="hud_export_done">Salvato in %1$s</string>
<string name="hud_export_failed">Impossibile salvare il rapporto dell\'HUD.</string>
<string name="hud_reset">Ripristina impostazioni HUD</string>
<string name="hud_reset_button">Ripristina</string>
<string name="hud_credit">FusionHUD di The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
<string name="drawer_scaling">Modalità di ridimensionamento</string>
<string name="drawer_scaling_sharpness">Nitidezza del ridimensionamento</string>
<string name="drawer_effects">Effetti schermo</string>
+59
View File
@@ -607,6 +607,65 @@
<string name="drawer_hud_color_amber">アンバー</string>
<string name="drawer_hud_color_violet">バイオレット</string>
<string name="drawer_hud_opacity">不透明度</string>
<string name="hud_matches_steam_overlay">フレームレート、フレームタイム、各測定値は、Steamのパフォーマンスオーバーレイと同じソースから取得しています。</string>
<string name="hud_size">サイズ</string>
<string name="hud_size_hint">HUDをタップしてもサイズを切り替えられます。</string>
<string name="hud_size_full">フル</string>
<string name="hud_size_tiles">タイル</string>
<string name="hud_size_pill">カプセル</string>
<string name="hud_size_minimal">ミニマル</string>
<string name="hud_size_mega">メガ</string>
<string name="hud_locked">位置を固定</string>
<string name="hud_locked_hint">HUDはドラッグで移動できます。長押しで固定または解除します。</string>
<string name="hud_group_look">外観</string>
<string name="hud_scale">画面上のサイズ</string>
<string name="hud_color_soft">ソフト</string>
<string name="hud_color_mid">標準</string>
<string name="hud_color_vivid">ビビッド</string>
<string name="hud_outline">アウトライン</string>
<string name="hud_outline_color">アウトラインの色</string>
<string name="hud_outline_gray">グレー</string>
<string name="hud_outline_theme">テーマカラー</string>
<string name="hud_group_metrics">表示項目</string>
<string name="hud_metric_graph">フレームタイムグラフ</string>
<string name="hud_metric_decimal">フレームレートの小数表示</string>
<string name="hud_metric_low001">0.01%最低値</string>
<string name="hud_metric_engine">グラフィックスエンジン</string>
<string name="hud_metric_gpu_model">GPU名</string>
<string name="hud_metric_gpu">GPU使用率</string>
<string name="hud_metric_gpu_temp">GPU温度</string>
<string name="hud_metric_cpu">CPU使用率</string>
<string name="hud_metric_per_core">コアごとのCPU</string>
<string name="hud_metric_temp">温度</string>
<string name="hud_metric_ram">メモリ</string>
<string name="hud_metric_vram">グラフィックスメモリ</string>
<string name="hud_metric_swap">スワップ</string>
<string name="hud_metric_battery">バッテリー残量</string>
<string name="hud_metric_power">消費電力</string>
<string name="hud_metric_network">ネットワーク</string>
<string name="hud_metric_resolution">解像度</string>
<string name="hud_metric_proton">Protonバージョン</string>
<string name="hud_metric_session">セッション時間</string>
<string name="hud_metric_clock">時計</string>
<string name="hud_group_temps">温度</string>
<string name="hud_temp_unit">単位</string>
<string name="hud_temp_bands">警告色</string>
<string name="hud_temp_bands_hint">温度が上限に近づくと、アンバー、次に赤で表示されます。</string>
<string name="hud_temp_bands_off">オフ</string>
<string name="hud_temp_bands_auto">自動</string>
<string name="hud_temp_bands_manual">手動</string>
<string name="hud_temp_red_cpu">CPUを赤にする温度</string>
<string name="hud_temp_red_gpu">GPUを赤にする温度</string>
<string name="hud_temp_red_battery">バッテリーを赤にする温度</string>
<string name="hud_group_more">その他</string>
<string name="hud_export">HUD診断</string>
<string name="hud_export_hint">HUDが読み取るすべてのセンサーのレポートをDownloads/DroidDeckに保存します。</string>
<string name="hud_export_button">保存</string>
<string name="hud_export_done">%1$s に保存しました</string>
<string name="hud_export_failed">HUDレポートを保存できませんでした。</string>
<string name="hud_reset">HUD設定をリセット</string>
<string name="hud_reset_button">リセット</string>
<string name="hud_credit">FusionHUD 作者:The412Banner、github.com/The412Banner/FusionHUD (GPL-3.0)。</string>
<string name="drawer_scaling">スケーリングモード</string>
<string name="drawer_scaling_sharpness">スケーリングのシャープネス</string>
<string name="drawer_effects">画面エフェクト</string>
+59
View File
@@ -607,6 +607,65 @@
<string name="drawer_hud_color_amber">호박색</string>
<string name="drawer_hud_color_violet">보라색</string>
<string name="drawer_hud_opacity">불투명도</string>
<string name="hud_matches_steam_overlay">프레임 속도, 프레임 타임, 측정값은 Steam 성능 오버레이와 같은 소스에서 가져옵니다.</string>
<string name="hud_size">크기</string>
<string name="hud_size_hint">HUD를 탭해도 크기가 바뀝니다.</string>
<string name="hud_size_full">전체</string>
<string name="hud_size_tiles">타일</string>
<string name="hud_size_pill">캡슐</string>
<string name="hud_size_minimal">미니멀</string>
<string name="hud_size_mega">메가</string>
<string name="hud_locked">위치 고정</string>
<string name="hud_locked_hint">HUD를 드래그하여 이동하고, 길게 눌러 고정하거나 해제합니다.</string>
<string name="hud_group_look">외관</string>
<string name="hud_scale">화면상 크기</string>
<string name="hud_color_soft">은은함</string>
<string name="hud_color_mid">보통</string>
<string name="hud_color_vivid">선명함</string>
<string name="hud_outline">외곽선</string>
<string name="hud_outline_color">외곽선 색상</string>
<string name="hud_outline_gray">회색</string>
<string name="hud_outline_theme">테마 색상</string>
<string name="hud_group_metrics">측정값</string>
<string name="hud_metric_graph">프레임 타임 그래프</string>
<string name="hud_metric_decimal">소수점 프레임 속도</string>
<string name="hud_metric_low001">0.01% 최저</string>
<string name="hud_metric_engine">그래픽 엔진</string>
<string name="hud_metric_gpu_model">GPU 이름</string>
<string name="hud_metric_gpu">GPU 사용률</string>
<string name="hud_metric_gpu_temp">GPU 온도</string>
<string name="hud_metric_cpu">CPU 사용률</string>
<string name="hud_metric_per_core">코어별 CPU</string>
<string name="hud_metric_temp">온도</string>
<string name="hud_metric_ram">메모리</string>
<string name="hud_metric_vram">그래픽 메모리</string>
<string name="hud_metric_swap">스왑</string>
<string name="hud_metric_battery">배터리 잔량</string>
<string name="hud_metric_power">소비 전력</string>
<string name="hud_metric_network">네트워크</string>
<string name="hud_metric_resolution">해상도</string>
<string name="hud_metric_proton">Proton 버전</string>
<string name="hud_metric_session">세션 시간</string>
<string name="hud_metric_clock">시계</string>
<string name="hud_group_temps">온도</string>
<string name="hud_temp_unit">단위</string>
<string name="hud_temp_bands">경고 색상</string>
<string name="hud_temp_bands_hint">온도가 한도에 가까워지면 호박색, 그다음 빨간색으로 바뀝니다.</string>
<string name="hud_temp_bands_off">끔</string>
<string name="hud_temp_bands_auto">자동</string>
<string name="hud_temp_bands_manual">수동</string>
<string name="hud_temp_red_cpu">CPU 빨간색 기준</string>
<string name="hud_temp_red_gpu">GPU 빨간색 기준</string>
<string name="hud_temp_red_battery">배터리 빨간색 기준</string>
<string name="hud_group_more">기타</string>
<string name="hud_export">HUD 진단</string>
<string name="hud_export_hint">HUD가 읽는 모든 센서의 보고서를 Downloads/DroidDeck에 저장합니다.</string>
<string name="hud_export_button">저장</string>
<string name="hud_export_done">%1$s에 저장됨</string>
<string name="hud_export_failed">HUD 보고서를 저장할 수 없습니다.</string>
<string name="hud_reset">HUD 설정 초기화</string>
<string name="hud_reset_button">초기화</string>
<string name="hud_credit">FusionHUD 제작: The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
<string name="drawer_scaling">스케일링 모드</string>
<string name="drawer_scaling_sharpness">스케일링 선명도</string>
<string name="drawer_effects">화면 효과</string>
+59
View File
@@ -605,6 +605,65 @@
<string name="drawer_hud_color_amber">Ambar</string>
<string name="drawer_hud_color_violet">Ungu</string>
<string name="drawer_hud_opacity">Kelegapan</string>
<string name="hud_matches_steam_overlay">Kadar bingkai, masa bingkai dan bacaan datang daripada sumber yang sama dengan tindanan prestasi Steam.</string>
<string name="hud_size">Saiz</string>
<string name="hud_size_hint">Mengetik HUD juga menukar saiznya.</string>
<string name="hud_size_full">Penuh</string>
<string name="hud_size_tiles">Jubin</string>
<string name="hud_size_pill">Pil</string>
<string name="hud_size_minimal">Minimal</string>
<string name="hud_size_mega">Mega</string>
<string name="hud_locked">Kunci di tempat</string>
<string name="hud_locked_hint">Seret HUD untuk mengalihkannya; tekan lama untuk mengunci atau membuka kuncinya.</string>
<string name="hud_group_look">Rupa</string>
<string name="hud_scale">Saiz pada skrin</string>
<string name="hud_color_soft">Lembut</string>
<string name="hud_color_mid">Sederhana</string>
<string name="hud_color_vivid">Terang</string>
<string name="hud_outline">Garis luar</string>
<string name="hud_outline_color">Warna garis luar</string>
<string name="hud_outline_gray">Kelabu</string>
<string name="hud_outline_theme">Warna tema</string>
<string name="hud_group_metrics">Bacaan</string>
<string name="hud_metric_graph">Graf masa bingkai</string>
<string name="hud_metric_decimal">Kadar bingkai dengan perpuluhan</string>
<string name="hud_metric_low001">0.01% terendah</string>
<string name="hud_metric_engine">Enjin grafik</string>
<string name="hud_metric_gpu_model">Nama GPU</string>
<string name="hud_metric_gpu">Beban GPU</string>
<string name="hud_metric_gpu_temp">Suhu GPU</string>
<string name="hud_metric_cpu">Beban CPU</string>
<string name="hud_metric_per_core">CPU setiap teras</string>
<string name="hud_metric_temp">Suhu</string>
<string name="hud_metric_ram">Memori</string>
<string name="hud_metric_vram">Memori grafik</string>
<string name="hud_metric_swap">Memori swap</string>
<string name="hud_metric_battery">Tahap bateri</string>
<string name="hud_metric_power">Penggunaan kuasa</string>
<string name="hud_metric_network">Rangkaian</string>
<string name="hud_metric_resolution">Resolusi</string>
<string name="hud_metric_proton">Versi Proton</string>
<string name="hud_metric_session">Tempoh sesi</string>
<string name="hud_metric_clock">Jam</string>
<string name="hud_group_temps">Suhu</string>
<string name="hud_temp_unit">Unit</string>
<string name="hud_temp_bands">Warna amaran</string>
<string name="hud_temp_bands_hint">Suhu bertukar ambar, kemudian merah, apabila menghampiri had.</string>
<string name="hud_temp_bands_off">Mati</string>
<string name="hud_temp_bands_auto">Automatik</string>
<string name="hud_temp_bands_manual">Manual</string>
<string name="hud_temp_red_cpu">CPU merah pada</string>
<string name="hud_temp_red_gpu">GPU merah pada</string>
<string name="hud_temp_red_battery">Bateri merah pada</string>
<string name="hud_group_more">Lagi</string>
<string name="hud_export">Diagnostik HUD</string>
<string name="hud_export_hint">Menyimpan laporan setiap sensor yang dibaca HUD ke Downloads/DroidDeck.</string>
<string name="hud_export_button">Simpan</string>
<string name="hud_export_done">Disimpan di %1$s</string>
<string name="hud_export_failed">Tidak dapat menyimpan laporan HUD.</string>
<string name="hud_reset">Set semula tetapan HUD</string>
<string name="hud_reset_button">Set semula</string>
<string name="hud_credit">FusionHUD oleh The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
<string name="drawer_scaling">Mod penskalaan</string>
<string name="drawer_scaling_sharpness">Ketajaman penskalaan</string>
<string name="drawer_effects">Kesan skrin</string>
+59
View File
@@ -607,6 +607,65 @@
<string name="drawer_hud_color_amber">Amber</string>
<string name="drawer_hud_color_violet">Fiolett</string>
<string name="drawer_hud_opacity">Opasitet</string>
<string name="hud_matches_steam_overlay">Bildefrekvens, bildetider og måleverdier kommer fra de samme kildene som Steams ytelsesoverlegg.</string>
<string name="hud_size">Størrelse</string>
<string name="hud_size_hint">Et trykk på HUD-en endrer også størrelsen.</string>
<string name="hud_size_full">Full</string>
<string name="hud_size_tiles">Fliser</string>
<string name="hud_size_pill">Pille</string>
<string name="hud_size_minimal">Minimal</string>
<string name="hud_size_mega">Mega</string>
<string name="hud_locked">Lås på plass</string>
<string name="hud_locked_hint">Dra HUD-en for å flytte den; et langt trykk låser eller låser den opp.</string>
<string name="hud_group_look">Utseende</string>
<string name="hud_scale">Størrelse på skjermen</string>
<string name="hud_color_soft">Myk</string>
<string name="hud_color_mid">Middels</string>
<string name="hud_color_vivid">Kraftig</string>
<string name="hud_outline">Kontur</string>
<string name="hud_outline_color">Konturfarge</string>
<string name="hud_outline_gray">Grå</string>
<string name="hud_outline_theme">Temafarge</string>
<string name="hud_group_metrics">Måleverdier</string>
<string name="hud_metric_graph">Bildetidsgraf</string>
<string name="hud_metric_decimal">Bildefrekvens med desimal</string>
<string name="hud_metric_low001">0.01% laveste</string>
<string name="hud_metric_engine">Grafikkmotor</string>
<string name="hud_metric_gpu_model">GPU-navn</string>
<string name="hud_metric_gpu">GPU-belastning</string>
<string name="hud_metric_gpu_temp">GPU-temperatur</string>
<string name="hud_metric_cpu">CPU-belastning</string>
<string name="hud_metric_per_core">CPU per kjerne</string>
<string name="hud_metric_temp">Temperaturer</string>
<string name="hud_metric_ram">Minne</string>
<string name="hud_metric_vram">Grafikkminne</string>
<string name="hud_metric_swap">Swap-minne</string>
<string name="hud_metric_battery">Batterinivå</string>
<string name="hud_metric_power">Strømforbruk</string>
<string name="hud_metric_network">Nettverk</string>
<string name="hud_metric_resolution">Oppløsning</string>
<string name="hud_metric_proton">Proton-versjon</string>
<string name="hud_metric_session">Sesjonstid</string>
<string name="hud_metric_clock">Klokke</string>
<string name="hud_group_temps">Temperaturer</string>
<string name="hud_temp_unit">Enhet</string>
<string name="hud_temp_bands">Varselfarger</string>
<string name="hud_temp_bands_hint">Temperaturer blir ravgule og så røde når de nærmer seg grensen.</string>
<string name="hud_temp_bands_off">Av</string>
<string name="hud_temp_bands_auto">Automatisk</string>
<string name="hud_temp_bands_manual">Manuell</string>
<string name="hud_temp_red_cpu">CPU rød ved</string>
<string name="hud_temp_red_gpu">GPU rød ved</string>
<string name="hud_temp_red_battery">Batteri rødt ved</string>
<string name="hud_group_more">Mer</string>
<string name="hud_export">HUD-diagnostikk</string>
<string name="hud_export_hint">Lagrer en rapport over alle sensorer HUD-en leser, i Downloads/DroidDeck.</string>
<string name="hud_export_button">Lagre</string>
<string name="hud_export_done">Lagret i %1$s</string>
<string name="hud_export_failed">Kunne ikke lagre HUD-rapporten.</string>
<string name="hud_reset">Tilbakestill HUD-innstillinger</string>
<string name="hud_reset_button">Tilbakestill</string>
<string name="hud_credit">FusionHUD av The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
<string name="drawer_scaling">Skaleringsmodus</string>
<string name="drawer_scaling_sharpness">Skaleringsskarphet</string>
<string name="drawer_effects">Skjermeffekter</string>
+59
View File
@@ -607,6 +607,65 @@
<string name="drawer_hud_color_amber">Amber</string>
<string name="drawer_hud_color_violet">Violet</string>
<string name="drawer_hud_opacity">Transparantie</string>
<string name="hud_matches_steam_overlay">Beeldsnelheid, frametijden en meetwaarden komen uit dezelfde bronnen als de prestatie-overlay van Steam.</string>
<string name="hud_size">Grootte</string>
<string name="hud_size_hint">Tikken op de HUD verandert ook de grootte.</string>
<string name="hud_size_full">Volledig</string>
<string name="hud_size_tiles">Tegels</string>
<string name="hud_size_pill">Pil</string>
<string name="hud_size_minimal">Minimaal</string>
<string name="hud_size_mega">Mega</string>
<string name="hud_locked">Vastzetten</string>
<string name="hud_locked_hint">Sleep de HUD om hem te verplaatsen; lang drukken zet hem vast of los.</string>
<string name="hud_group_look">Weergave</string>
<string name="hud_scale">Grootte op scherm</string>
<string name="hud_color_soft">Zacht</string>
<string name="hud_color_mid">Gemiddeld</string>
<string name="hud_color_vivid">Fel</string>
<string name="hud_outline">Contour</string>
<string name="hud_outline_color">Contourkleur</string>
<string name="hud_outline_gray">Grijs</string>
<string name="hud_outline_theme">Themakleur</string>
<string name="hud_group_metrics">Meetwaarden</string>
<string name="hud_metric_graph">Frametijdgrafiek</string>
<string name="hud_metric_decimal">Beeldsnelheid met decimaal</string>
<string name="hud_metric_low001">0.01% laagste</string>
<string name="hud_metric_engine">Grafische engine</string>
<string name="hud_metric_gpu_model">GPU-naam</string>
<string name="hud_metric_gpu">GPU-belasting</string>
<string name="hud_metric_gpu_temp">GPU-temperatuur</string>
<string name="hud_metric_cpu">CPU-belasting</string>
<string name="hud_metric_per_core">CPU per kern</string>
<string name="hud_metric_temp">Temperaturen</string>
<string name="hud_metric_ram">Geheugen</string>
<string name="hud_metric_vram">Grafisch geheugen</string>
<string name="hud_metric_swap">Swapgeheugen</string>
<string name="hud_metric_battery">Accuniveau</string>
<string name="hud_metric_power">Stroomverbruik</string>
<string name="hud_metric_network">Netwerk</string>
<string name="hud_metric_resolution">Resolutie</string>
<string name="hud_metric_proton">Proton-versie</string>
<string name="hud_metric_session">Sessieduur</string>
<string name="hud_metric_clock">Klok</string>
<string name="hud_group_temps">Temperaturen</string>
<string name="hud_temp_unit">Eenheid</string>
<string name="hud_temp_bands">Waarschuwingskleuren</string>
<string name="hud_temp_bands_hint">Temperaturen worden eerst amber en dan rood naarmate ze de limiet naderen.</string>
<string name="hud_temp_bands_off">Uit</string>
<string name="hud_temp_bands_auto">Automatisch</string>
<string name="hud_temp_bands_manual">Handmatig</string>
<string name="hud_temp_red_cpu">CPU rood vanaf</string>
<string name="hud_temp_red_gpu">GPU rood vanaf</string>
<string name="hud_temp_red_battery">Accu rood vanaf</string>
<string name="hud_group_more">Meer</string>
<string name="hud_export">HUD-diagnose</string>
<string name="hud_export_hint">Slaat een rapport van elke sensor die de HUD uitleest op in Downloads/DroidDeck.</string>
<string name="hud_export_button">Opslaan</string>
<string name="hud_export_done">Opgeslagen in %1$s</string>
<string name="hud_export_failed">Kan het HUD-rapport niet opslaan.</string>
<string name="hud_reset">HUD-instellingen resetten</string>
<string name="hud_reset_button">Resetten</string>
<string name="hud_credit">FusionHUD door The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
<string name="drawer_scaling">Schaalmodus</string>
<string name="drawer_scaling_sharpness">Schaalscherpte</string>
<string name="drawer_effects">Schermeffecten</string>
+59
View File
@@ -611,6 +611,65 @@
<string name="drawer_hud_color_amber">Bursztynowy</string>
<string name="drawer_hud_color_violet">Fioletowy</string>
<string name="drawer_hud_opacity">Przezroczystość</string>
<string name="hud_matches_steam_overlay">Liczba klatek, czasy klatek i odczyty pochodzą z tych samych źródeł co nakładka wydajności Steam.</string>
<string name="hud_size">Rozmiar</string>
<string name="hud_size_hint">Dotknięcie HUD również zmienia jego rozmiar.</string>
<string name="hud_size_full">Pełny</string>
<string name="hud_size_tiles">Kafelki</string>
<string name="hud_size_pill">Pigułka</string>
<string name="hud_size_minimal">Minimalny</string>
<string name="hud_size_mega">Mega</string>
<string name="hud_locked">Zablokuj w miejscu</string>
<string name="hud_locked_hint">Przeciągnij HUD, aby go przesunąć; długie naciśnięcie blokuje go lub odblokowuje.</string>
<string name="hud_group_look">Wygląd</string>
<string name="hud_scale">Rozmiar na ekranie</string>
<string name="hud_color_soft">Stonowany</string>
<string name="hud_color_mid">Średni</string>
<string name="hud_color_vivid">Żywy</string>
<string name="hud_outline">Obrys</string>
<string name="hud_outline_color">Kolor obrysu</string>
<string name="hud_outline_gray">Szary</string>
<string name="hud_outline_theme">Kolor motywu</string>
<string name="hud_group_metrics">Odczyty</string>
<string name="hud_metric_graph">Wykres czasu klatek</string>
<string name="hud_metric_decimal">Liczba klatek z miejscem po przecinku</string>
<string name="hud_metric_low001">0.01% najniższych</string>
<string name="hud_metric_engine">Silnik graficzny</string>
<string name="hud_metric_gpu_model">Nazwa GPU</string>
<string name="hud_metric_gpu">Obciążenie GPU</string>
<string name="hud_metric_gpu_temp">Temperatura GPU</string>
<string name="hud_metric_cpu">Obciążenie CPU</string>
<string name="hud_metric_per_core">CPU na rdzeń</string>
<string name="hud_metric_temp">Temperatury</string>
<string name="hud_metric_ram">Pamięć</string>
<string name="hud_metric_vram">Pamięć graficzna</string>
<string name="hud_metric_swap">Pamięć wymiany</string>
<string name="hud_metric_battery">Poziom baterii</string>
<string name="hud_metric_power">Pobór mocy</string>
<string name="hud_metric_network">Sieć</string>
<string name="hud_metric_resolution">Rozdzielczość</string>
<string name="hud_metric_proton">Wersja Protona</string>
<string name="hud_metric_session">Czas sesji</string>
<string name="hud_metric_clock">Zegar</string>
<string name="hud_group_temps">Temperatury</string>
<string name="hud_temp_unit">Jednostka</string>
<string name="hud_temp_bands">Kolory ostrzeżeń</string>
<string name="hud_temp_bands_hint">Temperatury zmieniają kolor na bursztynowy, a potem czerwony, gdy zbliżają się do limitu.</string>
<string name="hud_temp_bands_off">Wył.</string>
<string name="hud_temp_bands_auto">Automatycznie</string>
<string name="hud_temp_bands_manual">Ręcznie</string>
<string name="hud_temp_red_cpu">CPU na czerwono od</string>
<string name="hud_temp_red_gpu">GPU na czerwono od</string>
<string name="hud_temp_red_battery">Bateria na czerwono od</string>
<string name="hud_group_more">Więcej</string>
<string name="hud_export">Diagnostyka HUD</string>
<string name="hud_export_hint">Zapisuje w Downloads/DroidDeck raport ze wszystkich czujników odczytywanych przez HUD.</string>
<string name="hud_export_button">Zapisz</string>
<string name="hud_export_done">Zapisano w %1$s</string>
<string name="hud_export_failed">Nie udało się zapisać raportu HUD.</string>
<string name="hud_reset">Zresetuj ustawienia HUD</string>
<string name="hud_reset_button">Resetuj</string>
<string name="hud_credit">FusionHUD autorstwa The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
<string name="drawer_scaling">Tryb skalowania</string>
<string name="drawer_scaling_sharpness">Ostrość skalowania</string>
<string name="drawer_effects">Efekty ekranowe</string>
@@ -609,6 +609,65 @@
<string name="drawer_hud_color_amber">Âmbar</string>
<string name="drawer_hud_color_violet">Violeta</string>
<string name="drawer_hud_opacity">Opacidade</string>
<string name="hud_matches_steam_overlay">A taxa de fotogramas, os tempos de fotograma e as leituras vêm das mesmas fontes que a sobreposição de desempenho da Steam.</string>
<string name="hud_size">Tamanho</string>
<string name="hud_size_hint">Tocar no HUD também altera o tamanho.</string>
<string name="hud_size_full">Completo</string>
<string name="hud_size_tiles">Mosaicos</string>
<string name="hud_size_pill">Pílula</string>
<string name="hud_size_minimal">Mínimo</string>
<string name="hud_size_mega">Mega</string>
<string name="hud_locked">Bloquear posição</string>
<string name="hud_locked_hint">Arraste o HUD para o mover; um toque longo bloqueia-o ou desbloqueia-o.</string>
<string name="hud_group_look">Aspeto</string>
<string name="hud_scale">Tamanho no ecrã</string>
<string name="hud_color_soft">Suave</string>
<string name="hud_color_mid">Média</string>
<string name="hud_color_vivid">Viva</string>
<string name="hud_outline">Contorno</string>
<string name="hud_outline_color">Cor do contorno</string>
<string name="hud_outline_gray">Cinzento</string>
<string name="hud_outline_theme">Cor do tema</string>
<string name="hud_group_metrics">Leituras</string>
<string name="hud_metric_graph">Gráfico de tempo de fotograma</string>
<string name="hud_metric_decimal">Taxa de fotogramas com decimal</string>
<string name="hud_metric_low001">0.01% mais baixo</string>
<string name="hud_metric_engine">Motor gráfico</string>
<string name="hud_metric_gpu_model">Nome da GPU</string>
<string name="hud_metric_gpu">Utilização da GPU</string>
<string name="hud_metric_gpu_temp">Temperatura da GPU</string>
<string name="hud_metric_cpu">Utilização da CPU</string>
<string name="hud_metric_per_core">CPU por núcleo</string>
<string name="hud_metric_temp">Temperaturas</string>
<string name="hud_metric_ram">Memória</string>
<string name="hud_metric_vram">Memória gráfica</string>
<string name="hud_metric_swap">Memória swap</string>
<string name="hud_metric_battery">Nível da bateria</string>
<string name="hud_metric_power">Consumo de energia</string>
<string name="hud_metric_network">Rede</string>
<string name="hud_metric_resolution">Resolução</string>
<string name="hud_metric_proton">Versão do Proton</string>
<string name="hud_metric_session">Tempo de sessão</string>
<string name="hud_metric_clock">Relógio</string>
<string name="hud_group_temps">Temperaturas</string>
<string name="hud_temp_unit">Unidade</string>
<string name="hud_temp_bands">Cores de aviso</string>
<string name="hud_temp_bands_hint">As temperaturas ficam âmbar e depois vermelhas à medida que se aproximam do limite.</string>
<string name="hud_temp_bands_off">Desativado</string>
<string name="hud_temp_bands_auto">Automático</string>
<string name="hud_temp_bands_manual">Manual</string>
<string name="hud_temp_red_cpu">CPU a vermelho a partir de</string>
<string name="hud_temp_red_gpu">GPU a vermelho a partir de</string>
<string name="hud_temp_red_battery">Bateria a vermelho a partir de</string>
<string name="hud_group_more">Mais</string>
<string name="hud_export">Diagnóstico do HUD</string>
<string name="hud_export_hint">Guarda em Downloads/DroidDeck um relatório de cada sensor que o HUD lê.</string>
<string name="hud_export_button">Guardar</string>
<string name="hud_export_done">Guardado em %1$s</string>
<string name="hud_export_failed">Não foi possível guardar o relatório do HUD.</string>
<string name="hud_reset">Repor definições do HUD</string>
<string name="hud_reset_button">Repor</string>
<string name="hud_credit">FusionHUD por The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
<string name="drawer_scaling">Modo de escala</string>
<string name="drawer_scaling_sharpness">Nitidez da escala</string>
<string name="drawer_effects">Efeitos de ecrã</string>
+59
View File
@@ -609,6 +609,65 @@
<string name="drawer_hud_color_amber">Âmbar</string>
<string name="drawer_hud_color_violet">Violeta</string>
<string name="drawer_hud_opacity">Opacidade</string>
<string name="hud_matches_steam_overlay">Taxa de quadros, tempos de quadro e leituras vêm das mesmas fontes que a sobreposição de desempenho da Steam.</string>
<string name="hud_size">Tamanho</string>
<string name="hud_size_hint">Tocar no HUD também altera o tamanho.</string>
<string name="hud_size_full">Completo</string>
<string name="hud_size_tiles">Blocos</string>
<string name="hud_size_pill">Pílula</string>
<string name="hud_size_minimal">Mínimo</string>
<string name="hud_size_mega">Mega</string>
<string name="hud_locked">Travar posição</string>
<string name="hud_locked_hint">Arraste o HUD para movê-lo; um toque longo o trava ou destrava.</string>
<string name="hud_group_look">Aparência</string>
<string name="hud_scale">Tamanho na tela</string>
<string name="hud_color_soft">Suave</string>
<string name="hud_color_mid">Média</string>
<string name="hud_color_vivid">Viva</string>
<string name="hud_outline">Contorno</string>
<string name="hud_outline_color">Cor do contorno</string>
<string name="hud_outline_gray">Cinza</string>
<string name="hud_outline_theme">Cor do tema</string>
<string name="hud_group_metrics">Leituras</string>
<string name="hud_metric_graph">Gráfico de tempo de quadro</string>
<string name="hud_metric_decimal">Taxa de quadros com decimal</string>
<string name="hud_metric_low001">0.01% mais baixo</string>
<string name="hud_metric_engine">Motor gráfico</string>
<string name="hud_metric_gpu_model">Nome da GPU</string>
<string name="hud_metric_gpu">Uso da GPU</string>
<string name="hud_metric_gpu_temp">Temperatura da GPU</string>
<string name="hud_metric_cpu">Uso da CPU</string>
<string name="hud_metric_per_core">CPU por núcleo</string>
<string name="hud_metric_temp">Temperaturas</string>
<string name="hud_metric_ram">Memória</string>
<string name="hud_metric_vram">Memória gráfica</string>
<string name="hud_metric_swap">Memória swap</string>
<string name="hud_metric_battery">Nível da bateria</string>
<string name="hud_metric_power">Consumo de energia</string>
<string name="hud_metric_network">Rede</string>
<string name="hud_metric_resolution">Resolução</string>
<string name="hud_metric_proton">Versão do Proton</string>
<string name="hud_metric_session">Tempo de sessão</string>
<string name="hud_metric_clock">Relógio</string>
<string name="hud_group_temps">Temperaturas</string>
<string name="hud_temp_unit">Unidade</string>
<string name="hud_temp_bands">Cores de alerta</string>
<string name="hud_temp_bands_hint">As temperaturas ficam âmbar e depois vermelhas ao se aproximarem do limite.</string>
<string name="hud_temp_bands_off">Desativado</string>
<string name="hud_temp_bands_auto">Automático</string>
<string name="hud_temp_bands_manual">Manual</string>
<string name="hud_temp_red_cpu">CPU em vermelho a partir de</string>
<string name="hud_temp_red_gpu">GPU em vermelho a partir de</string>
<string name="hud_temp_red_battery">Bateria em vermelho a partir de</string>
<string name="hud_group_more">Mais</string>
<string name="hud_export">Diagnóstico do HUD</string>
<string name="hud_export_hint">Salva em Downloads/DroidDeck um relatório de cada sensor que o HUD lê.</string>
<string name="hud_export_button">Salvar</string>
<string name="hud_export_done">Salvo em %1$s</string>
<string name="hud_export_failed">Não foi possível salvar o relatório do HUD.</string>
<string name="hud_reset">Redefinir configurações do HUD</string>
<string name="hud_reset_button">Redefinir</string>
<string name="hud_credit">FusionHUD por The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
<string name="drawer_scaling">Modo de escala</string>
<string name="drawer_scaling_sharpness">Nitidez da escala</string>
<string name="drawer_effects">Efeitos de tela</string>
+59
View File
@@ -609,6 +609,65 @@
<string name="drawer_hud_color_amber">Chihlimbariu</string>
<string name="drawer_hud_color_violet">Violet</string>
<string name="drawer_hud_opacity">Opacitate</string>
<string name="hud_matches_steam_overlay">Rata de cadre, timpii de cadru și valorile citite provin din aceleași surse ca suprapunerea de performanță Steam.</string>
<string name="hud_size">Dimensiune</string>
<string name="hud_size_hint">Atingerea HUD-ului îi schimbă și dimensiunea.</string>
<string name="hud_size_full">Complet</string>
<string name="hud_size_tiles">Plăci</string>
<string name="hud_size_pill">Pastilă</string>
<string name="hud_size_minimal">Minimal</string>
<string name="hud_size_mega">Mega</string>
<string name="hud_locked">Blochează pe loc</string>
<string name="hud_locked_hint">Trage HUD-ul pentru a-l muta; o apăsare lungă îl blochează sau îl deblochează.</string>
<string name="hud_group_look">Aspect</string>
<string name="hud_scale">Dimensiune pe ecran</string>
<string name="hud_color_soft">Discretă</string>
<string name="hud_color_mid">Medie</string>
<string name="hud_color_vivid">Vie</string>
<string name="hud_outline">Contur</string>
<string name="hud_outline_color">Culoare contur</string>
<string name="hud_outline_gray">Gri</string>
<string name="hud_outline_theme">Culoarea temei</string>
<string name="hud_group_metrics">Valori</string>
<string name="hud_metric_graph">Grafic timp de cadru</string>
<string name="hud_metric_decimal">Rată de cadre cu zecimală</string>
<string name="hud_metric_low001">0.01% cele mai mici</string>
<string name="hud_metric_engine">Motor grafic</string>
<string name="hud_metric_gpu_model">Nume GPU</string>
<string name="hud_metric_gpu">Încărcare GPU</string>
<string name="hud_metric_gpu_temp">Temperatură GPU</string>
<string name="hud_metric_cpu">Încărcare CPU</string>
<string name="hud_metric_per_core">CPU pe nucleu</string>
<string name="hud_metric_temp">Temperaturi</string>
<string name="hud_metric_ram">Memorie</string>
<string name="hud_metric_vram">Memorie grafică</string>
<string name="hud_metric_swap">Memorie swap</string>
<string name="hud_metric_battery">Nivel baterie</string>
<string name="hud_metric_power">Consum de energie</string>
<string name="hud_metric_network">Rețea</string>
<string name="hud_metric_resolution">Rezoluție</string>
<string name="hud_metric_proton">Versiune Proton</string>
<string name="hud_metric_session">Durata sesiunii</string>
<string name="hud_metric_clock">Ceas</string>
<string name="hud_group_temps">Temperaturi</string>
<string name="hud_temp_unit">Unitate</string>
<string name="hud_temp_bands">Culori de avertizare</string>
<string name="hud_temp_bands_hint">Temperaturile devin chihlimbarii, apoi roșii, pe măsură ce se apropie de limită.</string>
<string name="hud_temp_bands_off">Dezactivat</string>
<string name="hud_temp_bands_auto">Automat</string>
<string name="hud_temp_bands_manual">Manual</string>
<string name="hud_temp_red_cpu">CPU roșu de la</string>
<string name="hud_temp_red_gpu">GPU roșu de la</string>
<string name="hud_temp_red_battery">Baterie roșie de la</string>
<string name="hud_group_more">Mai mult</string>
<string name="hud_export">Diagnosticare HUD</string>
<string name="hud_export_hint">Salvează în Downloads/DroidDeck un raport despre fiecare senzor citit de HUD.</string>
<string name="hud_export_button">Salvează</string>
<string name="hud_export_done">Salvat în %1$s</string>
<string name="hud_export_failed">Raportul HUD nu a putut fi salvat.</string>
<string name="hud_reset">Resetează setările HUD</string>
<string name="hud_reset_button">Resetează</string>
<string name="hud_credit">FusionHUD de The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
<string name="drawer_scaling">Mod de scalare</string>
<string name="drawer_scaling_sharpness">Claritatea scalării</string>
<string name="drawer_effects">Efecte de ecran</string>
+59
View File
@@ -613,6 +613,65 @@
<string name="drawer_hud_color_amber">Янтарный</string>
<string name="drawer_hud_color_violet">Фиолетовый</string>
<string name="drawer_hud_opacity">Непрозрачность</string>
<string name="hud_matches_steam_overlay">Частота кадров, время кадров и показания берутся из тех же источников, что и оверлей производительности Steam.</string>
<string name="hud_size">Размер</string>
<string name="hud_size_hint">Касание HUD тоже меняет его размер.</string>
<string name="hud_size_full">Полный</string>
<string name="hud_size_tiles">Плитки</string>
<string name="hud_size_pill">Капсула</string>
<string name="hud_size_minimal">Минимальный</string>
<string name="hud_size_mega">Мега</string>
<string name="hud_locked">Закрепить на месте</string>
<string name="hud_locked_hint">Перетащите HUD, чтобы переместить его; долгое нажатие закрепляет или открепляет его.</string>
<string name="hud_group_look">Внешний вид</string>
<string name="hud_scale">Размер на экране</string>
<string name="hud_color_soft">Мягкий</string>
<string name="hud_color_mid">Средний</string>
<string name="hud_color_vivid">Яркий</string>
<string name="hud_outline">Контур</string>
<string name="hud_outline_color">Цвет контура</string>
<string name="hud_outline_gray">Серый</string>
<string name="hud_outline_theme">Цвет темы</string>
<string name="hud_group_metrics">Показатели</string>
<string name="hud_metric_graph">График времени кадров</string>
<string name="hud_metric_decimal">Частота кадров с десятыми</string>
<string name="hud_metric_low001">0.01% минимальных</string>
<string name="hud_metric_engine">Графический движок</string>
<string name="hud_metric_gpu_model">Название GPU</string>
<string name="hud_metric_gpu">Загрузка GPU</string>
<string name="hud_metric_gpu_temp">Температура GPU</string>
<string name="hud_metric_cpu">Загрузка CPU</string>
<string name="hud_metric_per_core">CPU по ядрам</string>
<string name="hud_metric_temp">Температуры</string>
<string name="hud_metric_ram">Память</string>
<string name="hud_metric_vram">Видеопамять</string>
<string name="hud_metric_swap">Подкачка</string>
<string name="hud_metric_battery">Заряд батареи</string>
<string name="hud_metric_power">Потребляемая мощность</string>
<string name="hud_metric_network">Сеть</string>
<string name="hud_metric_resolution">Разрешение</string>
<string name="hud_metric_proton">Версия Proton</string>
<string name="hud_metric_session">Время сессии</string>
<string name="hud_metric_clock">Часы</string>
<string name="hud_group_temps">Температуры</string>
<string name="hud_temp_unit">Единицы</string>
<string name="hud_temp_bands">Цвета предупреждений</string>
<string name="hud_temp_bands_hint">Температуры становятся янтарными, затем красными по мере приближения к пределу.</string>
<string name="hud_temp_bands_off">Выкл.</string>
<string name="hud_temp_bands_auto">Автоматически</string>
<string name="hud_temp_bands_manual">Вручную</string>
<string name="hud_temp_red_cpu">CPU: красный от</string>
<string name="hud_temp_red_gpu">GPU: красный от</string>
<string name="hud_temp_red_battery">Батарея: красный от</string>
<string name="hud_group_more">Еще</string>
<string name="hud_export">Диагностика HUD</string>
<string name="hud_export_hint">Сохраняет в Downloads/DroidDeck отчет по всем датчикам, которые считывает HUD.</string>
<string name="hud_export_button">Сохранить</string>
<string name="hud_export_done">Сохранено: %1$s</string>
<string name="hud_export_failed">Не удалось сохранить отчет HUD.</string>
<string name="hud_reset">Сбросить настройки HUD</string>
<string name="hud_reset_button">Сбросить</string>
<string name="hud_credit">FusionHUD от The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
<string name="drawer_scaling">Режим масштабирования</string>
<string name="drawer_scaling_sharpness">Резкость масштабирования</string>
<string name="drawer_effects">Экранные эффекты</string>
+59
View File
@@ -607,6 +607,65 @@
<string name="drawer_hud_color_amber">Amber</string>
<string name="drawer_hud_color_violet">Lila</string>
<string name="drawer_hud_opacity">Opacitet</string>
<string name="hud_matches_steam_overlay">Bildfrekvens, bildtider och mätvärden kommer från samma källor som Steams prestandaöverlägg.</string>
<string name="hud_size">Storlek</string>
<string name="hud_size_hint">Ett tryck på HUD:en ändrar också dess storlek.</string>
<string name="hud_size_full">Full</string>
<string name="hud_size_tiles">Rutor</string>
<string name="hud_size_pill">Piller</string>
<string name="hud_size_minimal">Minimal</string>
<string name="hud_size_mega">Mega</string>
<string name="hud_locked">Lås på plats</string>
<string name="hud_locked_hint">Dra HUD:en för att flytta den; ett långt tryck låser eller låser upp den.</string>
<string name="hud_group_look">Utseende</string>
<string name="hud_scale">Storlek på skärmen</string>
<string name="hud_color_soft">Mjuk</string>
<string name="hud_color_mid">Mellan</string>
<string name="hud_color_vivid">Livfull</string>
<string name="hud_outline">Kontur</string>
<string name="hud_outline_color">Konturfärg</string>
<string name="hud_outline_gray">Grå</string>
<string name="hud_outline_theme">Temafärg</string>
<string name="hud_group_metrics">Mätvärden</string>
<string name="hud_metric_graph">Bildtidsgraf</string>
<string name="hud_metric_decimal">Bildfrekvens med decimal</string>
<string name="hud_metric_low001">0.01% lägsta</string>
<string name="hud_metric_engine">Grafikmotor</string>
<string name="hud_metric_gpu_model">GPU-namn</string>
<string name="hud_metric_gpu">GPU-belastning</string>
<string name="hud_metric_gpu_temp">GPU-temperatur</string>
<string name="hud_metric_cpu">CPU-belastning</string>
<string name="hud_metric_per_core">CPU per kärna</string>
<string name="hud_metric_temp">Temperaturer</string>
<string name="hud_metric_ram">Minne</string>
<string name="hud_metric_vram">Grafikminne</string>
<string name="hud_metric_swap">Växlingsminne</string>
<string name="hud_metric_battery">Batterinivå</string>
<string name="hud_metric_power">Strömförbrukning</string>
<string name="hud_metric_network">Nätverk</string>
<string name="hud_metric_resolution">Upplösning</string>
<string name="hud_metric_proton">Proton-version</string>
<string name="hud_metric_session">Sessionstid</string>
<string name="hud_metric_clock">Klocka</string>
<string name="hud_group_temps">Temperaturer</string>
<string name="hud_temp_unit">Enhet</string>
<string name="hud_temp_bands">Varningsfärger</string>
<string name="hud_temp_bands_hint">Temperaturer blir bärnstensfärgade och sedan röda när de närmar sig gränsen.</string>
<string name="hud_temp_bands_off">Av</string>
<string name="hud_temp_bands_auto">Automatiskt</string>
<string name="hud_temp_bands_manual">Manuell</string>
<string name="hud_temp_red_cpu">CPU röd vid</string>
<string name="hud_temp_red_gpu">GPU röd vid</string>
<string name="hud_temp_red_battery">Batteri rött vid</string>
<string name="hud_group_more">Mer</string>
<string name="hud_export">HUD-diagnostik</string>
<string name="hud_export_hint">Sparar en rapport över alla sensorer som HUD:en läser i Downloads/DroidDeck.</string>
<string name="hud_export_button">Spara</string>
<string name="hud_export_done">Sparad i %1$s</string>
<string name="hud_export_failed">Det gick inte att spara HUD-rapporten.</string>
<string name="hud_reset">Återställ HUD-inställningar</string>
<string name="hud_reset_button">Återställ</string>
<string name="hud_credit">FusionHUD av The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
<string name="drawer_scaling">Skalningsläge</string>
<string name="drawer_scaling_sharpness">Skalningsskärpa</string>
<string name="drawer_effects">Skärmeffekter</string>
+59
View File
@@ -605,6 +605,65 @@
<string name="drawer_hud_color_amber">อำพัน</string>
<string name="drawer_hud_color_violet">ม่วง</string>
<string name="drawer_hud_opacity">ความโปร่งใส</string>
<string name="hud_matches_steam_overlay">อัตราเฟรม เวลาเฟรม และค่าที่อ่านได้มาจากแหล่งเดียวกับโอเวอร์เลย์ประสิทธิภาพของ Steam</string>
<string name="hud_size">ขนาด</string>
<string name="hud_size_hint">การแตะ HUD จะเปลี่ยนขนาดด้วย</string>
<string name="hud_size_full">เต็ม</string>
<string name="hud_size_tiles">ไทล์</string>
<string name="hud_size_pill">แคปซูล</string>
<string name="hud_size_minimal">มินิมอล</string>
<string name="hud_size_mega">เมกะ</string>
<string name="hud_locked">ล็อกตำแหน่ง</string>
<string name="hud_locked_hint">ลาก HUD เพื่อย้าย กดค้างเพื่อล็อกหรือปลดล็อก</string>
<string name="hud_group_look">รูปลักษณ์</string>
<string name="hud_scale">ขนาดบนหน้าจอ</string>
<string name="hud_color_soft">อ่อน</string>
<string name="hud_color_mid">ปานกลาง</string>
<string name="hud_color_vivid">สด</string>
<string name="hud_outline">เส้นขอบ</string>
<string name="hud_outline_color">สีเส้นขอบ</string>
<string name="hud_outline_gray">เทา</string>
<string name="hud_outline_theme">สีธีม</string>
<string name="hud_group_metrics">ค่าที่แสดง</string>
<string name="hud_metric_graph">กราฟเวลาเฟรม</string>
<string name="hud_metric_decimal">อัตราเฟรมแบบทศนิยม</string>
<string name="hud_metric_low001">0.01% ต่ำสุด</string>
<string name="hud_metric_engine">เอนจินกราฟิก</string>
<string name="hud_metric_gpu_model">ชื่อ GPU</string>
<string name="hud_metric_gpu">โหลด GPU</string>
<string name="hud_metric_gpu_temp">อุณหภูมิ GPU</string>
<string name="hud_metric_cpu">โหลด CPU</string>
<string name="hud_metric_per_core">CPU รายคอร์</string>
<string name="hud_metric_temp">อุณหภูมิ</string>
<string name="hud_metric_ram">หน่วยความจำ</string>
<string name="hud_metric_vram">หน่วยความจำกราฟิก</string>
<string name="hud_metric_swap">พื้นที่สว็อป</string>
<string name="hud_metric_battery">ระดับแบตเตอรี่</string>
<string name="hud_metric_power">การใช้พลังงาน</string>
<string name="hud_metric_network">เครือข่าย</string>
<string name="hud_metric_resolution">ความละเอียด</string>
<string name="hud_metric_proton">เวอร์ชัน Proton</string>
<string name="hud_metric_session">เวลาเซสชัน</string>
<string name="hud_metric_clock">นาฬิกา</string>
<string name="hud_group_temps">อุณหภูมิ</string>
<string name="hud_temp_unit">หน่วย</string>
<string name="hud_temp_bands">สีเตือน</string>
<string name="hud_temp_bands_hint">อุณหภูมิจะเปลี่ยนเป็นสีอำพันแล้วเป็นสีแดงเมื่อใกล้ถึงขีดจำกัด</string>
<string name="hud_temp_bands_off">ปิด</string>
<string name="hud_temp_bands_auto">อัตโนมัติ</string>
<string name="hud_temp_bands_manual">กำหนดเอง</string>
<string name="hud_temp_red_cpu">CPU แดงที่</string>
<string name="hud_temp_red_gpu">GPU แดงที่</string>
<string name="hud_temp_red_battery">แบตเตอรี่แดงที่</string>
<string name="hud_group_more">เพิ่มเติม</string>
<string name="hud_export">การวินิจฉัย HUD</string>
<string name="hud_export_hint">บันทึกรายงานของเซนเซอร์ทุกตัวที่ HUD อ่านไปที่ Downloads/DroidDeck</string>
<string name="hud_export_button">บันทึก</string>
<string name="hud_export_done">บันทึกไปที่ %1$s แล้ว</string>
<string name="hud_export_failed">บันทึกรายงาน HUD ไม่ได้</string>
<string name="hud_reset">รีเซ็ตการตั้งค่า HUD</string>
<string name="hud_reset_button">รีเซ็ต</string>
<string name="hud_credit">FusionHUD โดย The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0)</string>
<string name="drawer_scaling">โหมดการปรับขนาด</string>
<string name="drawer_scaling_sharpness">ความคมชัดของการปรับขนาด</string>
<string name="drawer_effects">เอฟเฟกต์หน้าจอ</string>
+59
View File
@@ -607,6 +607,65 @@
<string name="drawer_hud_color_amber">Kehribar</string>
<string name="drawer_hud_color_violet">Mor</string>
<string name="drawer_hud_opacity">Opaklık</string>
<string name="hud_matches_steam_overlay">Kare hızı, kare süreleri ve ölçümler, Steam\'in performans katmanıyla aynı kaynaklardan gelir.</string>
<string name="hud_size">Boyut</string>
<string name="hud_size_hint">HUD\'a dokunmak da boyutunu değiştirir.</string>
<string name="hud_size_full">Tam</string>
<string name="hud_size_tiles">Kutucuklar</string>
<string name="hud_size_pill">Hap</string>
<string name="hud_size_minimal">Minimal</string>
<string name="hud_size_mega">Mega</string>
<string name="hud_locked">Yerinde kilitle</string>
<string name="hud_locked_hint">Taşımak için HUD\'u sürükleyin; uzun basmak onu kilitler veya kilidini açar.</string>
<string name="hud_group_look">Görünüm</string>
<string name="hud_scale">Ekrandaki boyut</string>
<string name="hud_color_soft">Yumuşak</string>
<string name="hud_color_mid">Orta</string>
<string name="hud_color_vivid">Canlı</string>
<string name="hud_outline">Dış hat</string>
<string name="hud_outline_color">Dış hat rengi</string>
<string name="hud_outline_gray">Gri</string>
<string name="hud_outline_theme">Tema rengi</string>
<string name="hud_group_metrics">Ölçümler</string>
<string name="hud_metric_graph">Kare süresi grafiği</string>
<string name="hud_metric_decimal">Ondalıklı kare hızı</string>
<string name="hud_metric_low001">0.01% en düşük</string>
<string name="hud_metric_engine">Grafik motoru</string>
<string name="hud_metric_gpu_model">GPU adı</string>
<string name="hud_metric_gpu">GPU yükü</string>
<string name="hud_metric_gpu_temp">GPU sıcaklığı</string>
<string name="hud_metric_cpu">CPU yükü</string>
<string name="hud_metric_per_core">Çekirdek başına CPU</string>
<string name="hud_metric_temp">Sıcaklıklar</string>
<string name="hud_metric_ram">Bellek</string>
<string name="hud_metric_vram">Grafik belleği</string>
<string name="hud_metric_swap">Takas alanı</string>
<string name="hud_metric_battery">Pil seviyesi</string>
<string name="hud_metric_power">Güç tüketimi</string>
<string name="hud_metric_network">Ağ</string>
<string name="hud_metric_resolution">Çözünürlük</string>
<string name="hud_metric_proton">Proton sürümü</string>
<string name="hud_metric_session">Oturum süresi</string>
<string name="hud_metric_clock">Saat</string>
<string name="hud_group_temps">Sıcaklıklar</string>
<string name="hud_temp_unit">Birim</string>
<string name="hud_temp_bands">Uyarı renkleri</string>
<string name="hud_temp_bands_hint">Sıcaklıklar sınıra yaklaştıkça önce kehribar, sonra kırmızı olur.</string>
<string name="hud_temp_bands_off">Kapalı</string>
<string name="hud_temp_bands_auto">Otomatik</string>
<string name="hud_temp_bands_manual">Manuel</string>
<string name="hud_temp_red_cpu">CPU kırmızı eşiği</string>
<string name="hud_temp_red_gpu">GPU kırmızı eşiği</string>
<string name="hud_temp_red_battery">Pil kırmızı eşiği</string>
<string name="hud_group_more">Daha fazla</string>
<string name="hud_export">HUD tanılaması</string>
<string name="hud_export_hint">HUD\'un okuduğu her sensörün raporunu Downloads/DroidDeck klasörüne kaydeder.</string>
<string name="hud_export_button">Kaydet</string>
<string name="hud_export_done">%1$s konumuna kaydedildi</string>
<string name="hud_export_failed">HUD raporu kaydedilemedi.</string>
<string name="hud_reset">HUD ayarlarını sıfırla</string>
<string name="hud_reset_button">Sıfırla</string>
<string name="hud_credit">FusionHUD, yapımcı: The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
<string name="drawer_scaling">Ölçekleme modu</string>
<string name="drawer_scaling_sharpness">Ölçekleme keskinliği</string>
<string name="drawer_effects">Ekran efektleri</string>
+59
View File
@@ -611,6 +611,65 @@
<string name="drawer_hud_color_amber">Бурштиновий</string>
<string name="drawer_hud_color_violet">Фіолетовий</string>
<string name="drawer_hud_opacity">Непрозорість</string>
<string name="hud_matches_steam_overlay">Частота кадрів, час кадрів і показники беруться з тих самих джерел, що й оверлей продуктивності Steam.</string>
<string name="hud_size">Розмір</string>
<string name="hud_size_hint">Дотик до HUD також змінює його розмір.</string>
<string name="hud_size_full">Повний</string>
<string name="hud_size_tiles">Плитки</string>
<string name="hud_size_pill">Капсула</string>
<string name="hud_size_minimal">Мінімальний</string>
<string name="hud_size_mega">Мега</string>
<string name="hud_locked">Закріпити на місці</string>
<string name="hud_locked_hint">Перетягніть HUD, щоб перемістити його; довге натискання закріплює або відкріплює його.</string>
<string name="hud_group_look">Вигляд</string>
<string name="hud_scale">Розмір на екрані</string>
<string name="hud_color_soft">М\'який</string>
<string name="hud_color_mid">Середній</string>
<string name="hud_color_vivid">Яскравий</string>
<string name="hud_outline">Контур</string>
<string name="hud_outline_color">Колір контуру</string>
<string name="hud_outline_gray">Сірий</string>
<string name="hud_outline_theme">Колір теми</string>
<string name="hud_group_metrics">Показники</string>
<string name="hud_metric_graph">Графік часу кадрів</string>
<string name="hud_metric_decimal">Частота кадрів із десятими</string>
<string name="hud_metric_low001">0.01% мінімальних</string>
<string name="hud_metric_engine">Графічний рушій</string>
<string name="hud_metric_gpu_model">Назва GPU</string>
<string name="hud_metric_gpu">Навантаження GPU</string>
<string name="hud_metric_gpu_temp">Температура GPU</string>
<string name="hud_metric_cpu">Навантаження CPU</string>
<string name="hud_metric_per_core">CPU за ядрами</string>
<string name="hud_metric_temp">Температури</string>
<string name="hud_metric_ram">Пам\'ять</string>
<string name="hud_metric_vram">Відеопам\'ять</string>
<string name="hud_metric_swap">Підкачка</string>
<string name="hud_metric_battery">Заряд батареї</string>
<string name="hud_metric_power">Споживана потужність</string>
<string name="hud_metric_network">Мережа</string>
<string name="hud_metric_resolution">Роздільна здатність</string>
<string name="hud_metric_proton">Версія Proton</string>
<string name="hud_metric_session">Час сеансу</string>
<string name="hud_metric_clock">Годинник</string>
<string name="hud_group_temps">Температури</string>
<string name="hud_temp_unit">Одиниці</string>
<string name="hud_temp_bands">Кольори попередження</string>
<string name="hud_temp_bands_hint">Температури стають бурштиновими, а потім червоними, коли наближаються до межі.</string>
<string name="hud_temp_bands_off">Вимк.</string>
<string name="hud_temp_bands_auto">Автоматично</string>
<string name="hud_temp_bands_manual">Вручну</string>
<string name="hud_temp_red_cpu">CPU: червоний від</string>
<string name="hud_temp_red_gpu">GPU: червоний від</string>
<string name="hud_temp_red_battery">Батарея: червоний від</string>
<string name="hud_group_more">Більше</string>
<string name="hud_export">Діагностика HUD</string>
<string name="hud_export_hint">Зберігає в Downloads/DroidDeck звіт про всі датчики, які зчитує HUD.</string>
<string name="hud_export_button">Зберегти</string>
<string name="hud_export_done">Збережено: %1$s</string>
<string name="hud_export_failed">Не вдалося зберегти звіт HUD.</string>
<string name="hud_reset">Скинути налаштування HUD</string>
<string name="hud_reset_button">Скинути</string>
<string name="hud_credit">FusionHUD від The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
<string name="drawer_scaling">Режим масштабування</string>
<string name="drawer_scaling_sharpness">Чіткість масштабування</string>
<string name="drawer_effects">Ефекти екрана</string>
+59
View File
@@ -605,6 +605,65 @@
<string name="drawer_hud_color_amber">Hổ phách</string>
<string name="drawer_hud_color_violet">Tím</string>
<string name="drawer_hud_opacity">Độ mờ</string>
<string name="hud_matches_steam_overlay">Tốc độ khung hình, thời gian khung hình và các chỉ số lấy từ cùng nguồn với lớp phủ hiệu năng của Steam.</string>
<string name="hud_size">Kích thước</string>
<string name="hud_size_hint">Chạm vào HUD cũng thay đổi kích thước của nó.</string>
<string name="hud_size_full">Đầy đủ</string>
<string name="hud_size_tiles">Ô</string>
<string name="hud_size_pill">Dạng viên</string>
<string name="hud_size_minimal">Tối giản</string>
<string name="hud_size_mega">Mega</string>
<string name="hud_locked">Khóa vị trí</string>
<string name="hud_locked_hint">Kéo HUD để di chuyển; nhấn giữ để khóa hoặc mở khóa.</string>
<string name="hud_group_look">Giao diện</string>
<string name="hud_scale">Kích thước trên màn hình</string>
<string name="hud_color_soft">Dịu</string>
<string name="hud_color_mid">Vừa</string>
<string name="hud_color_vivid">Rực rỡ</string>
<string name="hud_outline">Viền</string>
<string name="hud_outline_color">Màu viền</string>
<string name="hud_outline_gray">Xám</string>
<string name="hud_outline_theme">Màu giao diện</string>
<string name="hud_group_metrics">Chỉ số</string>
<string name="hud_metric_graph">Biểu đồ thời gian khung hình</string>
<string name="hud_metric_decimal">Tốc độ khung hình có số thập phân</string>
<string name="hud_metric_low001">0.01% thấp nhất</string>
<string name="hud_metric_engine">Engine đồ họa</string>
<string name="hud_metric_gpu_model">Tên GPU</string>
<string name="hud_metric_gpu">Tải GPU</string>
<string name="hud_metric_gpu_temp">Nhiệt độ GPU</string>
<string name="hud_metric_cpu">Tải CPU</string>
<string name="hud_metric_per_core">CPU theo từng lõi</string>
<string name="hud_metric_temp">Nhiệt độ</string>
<string name="hud_metric_ram">Bộ nhớ</string>
<string name="hud_metric_vram">Bộ nhớ đồ họa</string>
<string name="hud_metric_swap">Bộ nhớ swap</string>
<string name="hud_metric_battery">Mức pin</string>
<string name="hud_metric_power">Công suất tiêu thụ</string>
<string name="hud_metric_network">Mạng</string>
<string name="hud_metric_resolution">Độ phân giải</string>
<string name="hud_metric_proton">Phiên bản Proton</string>
<string name="hud_metric_session">Thời gian phiên</string>
<string name="hud_metric_clock">Đồng hồ</string>
<string name="hud_group_temps">Nhiệt độ</string>
<string name="hud_temp_unit">Đơn vị</string>
<string name="hud_temp_bands">Màu cảnh báo</string>
<string name="hud_temp_bands_hint">Nhiệt độ chuyển sang màu hổ phách, rồi đỏ khi gần đến giới hạn.</string>
<string name="hud_temp_bands_off">Tắt</string>
<string name="hud_temp_bands_auto">Tự động</string>
<string name="hud_temp_bands_manual">Thủ công</string>
<string name="hud_temp_red_cpu">CPU đỏ từ</string>
<string name="hud_temp_red_gpu">GPU đỏ từ</string>
<string name="hud_temp_red_battery">Pin đỏ từ</string>
<string name="hud_group_more">Thêm</string>
<string name="hud_export">Chẩn đoán HUD</string>
<string name="hud_export_hint">Lưu báo cáo về mọi cảm biến mà HUD đọc vào Downloads/DroidDeck.</string>
<string name="hud_export_button">Lưu</string>
<string name="hud_export_done">Đã lưu vào %1$s</string>
<string name="hud_export_failed">Không thể lưu báo cáo HUD.</string>
<string name="hud_reset">Đặt lại thiết lập HUD</string>
<string name="hud_reset_button">Đặt lại</string>
<string name="hud_credit">FusionHUD của The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
<string name="drawer_scaling">Chế độ chia tỷ lệ</string>
<string name="drawer_scaling_sharpness">Độ sắc nét khi chia tỷ lệ</string>
<string name="drawer_effects">Hiệu ứng màn hình</string>
@@ -607,6 +607,65 @@
<string name="drawer_hud_color_amber">琥珀</string>
<string name="drawer_hud_color_violet">紫罗兰</string>
<string name="drawer_hud_opacity">不透明度</string>
<string name="hud_matches_steam_overlay">帧率、帧时间和各项读数与 Steam 性能叠加层来自相同的数据源。</string>
<string name="hud_size">大小</string>
<string name="hud_size_hint">轻点 HUD 也可以切换大小。</string>
<string name="hud_size_full">完整</string>
<string name="hud_size_tiles">磁贴</string>
<string name="hud_size_pill">胶囊</string>
<string name="hud_size_minimal">极简</string>
<string name="hud_size_mega">超大</string>
<string name="hud_locked">锁定位置</string>
<string name="hud_locked_hint">拖动 HUD 可移动位置;长按可锁定或解锁。</string>
<string name="hud_group_look">外观</string>
<string name="hud_scale">屏幕显示大小</string>
<string name="hud_color_soft">柔和</string>
<string name="hud_color_mid">适中</string>
<string name="hud_color_vivid">鲜艳</string>
<string name="hud_outline">描边</string>
<string name="hud_outline_color">描边颜色</string>
<string name="hud_outline_gray">灰色</string>
<string name="hud_outline_theme">主题色</string>
<string name="hud_group_metrics">读数</string>
<string name="hud_metric_graph">帧时间图表</string>
<string name="hud_metric_decimal">帧率显示小数</string>
<string name="hud_metric_low001">0.01% 最低帧</string>
<string name="hud_metric_engine">图形引擎</string>
<string name="hud_metric_gpu_model">GPU 名称</string>
<string name="hud_metric_gpu">GPU 负载</string>
<string name="hud_metric_gpu_temp">GPU 温度</string>
<string name="hud_metric_cpu">CPU 负载</string>
<string name="hud_metric_per_core">CPU 各核心</string>
<string name="hud_metric_temp">温度</string>
<string name="hud_metric_ram">内存</string>
<string name="hud_metric_vram">显存</string>
<string name="hud_metric_swap">交换空间</string>
<string name="hud_metric_battery">电池电量</string>
<string name="hud_metric_power">功耗</string>
<string name="hud_metric_network">网络</string>
<string name="hud_metric_resolution">分辨率</string>
<string name="hud_metric_proton">Proton 版本</string>
<string name="hud_metric_session">会话时长</string>
<string name="hud_metric_clock">时钟</string>
<string name="hud_group_temps">温度</string>
<string name="hud_temp_unit">单位</string>
<string name="hud_temp_bands">警告颜色</string>
<string name="hud_temp_bands_hint">温度接近上限时会先变为琥珀色,再变为红色。</string>
<string name="hud_temp_bands_off">关</string>
<string name="hud_temp_bands_auto">自动</string>
<string name="hud_temp_bands_manual">手动</string>
<string name="hud_temp_red_cpu">CPU 变红温度</string>
<string name="hud_temp_red_gpu">GPU 变红温度</string>
<string name="hud_temp_red_battery">电池变红温度</string>
<string name="hud_group_more">更多</string>
<string name="hud_export">HUD 诊断</string>
<string name="hud_export_hint">将 HUD 读取的所有传感器报告保存到 Downloads/DroidDeck。</string>
<string name="hud_export_button">保存</string>
<string name="hud_export_done">已保存到 %1$s</string>
<string name="hud_export_failed">无法保存 HUD 报告。</string>
<string name="hud_reset">重置 HUD 设置</string>
<string name="hud_reset_button">重置</string>
<string name="hud_credit">FusionHUD,作者 The412Banner,github.com/The412Banner/FusionHUD (GPL-3.0)。</string>
<string name="drawer_scaling">缩放模式</string>
<string name="drawer_scaling_sharpness">缩放锐度</string>
<string name="drawer_effects">屏幕效果</string>
@@ -607,6 +607,65 @@
<string name="drawer_hud_color_amber">琥珀色</string>
<string name="drawer_hud_color_violet">紫羅蘭</string>
<string name="drawer_hud_opacity">不透明度</string>
<string name="hud_matches_steam_overlay">幀率、幀時間和各項讀數與 Steam 效能疊加層來自相同的來源。</string>
<string name="hud_size">大小</string>
<string name="hud_size_hint">輕按 HUD 亦可切換大小。</string>
<string name="hud_size_full">完整</string>
<string name="hud_size_tiles">方塊</string>
<string name="hud_size_pill">膠囊</string>
<string name="hud_size_minimal">極簡</string>
<string name="hud_size_mega">超大</string>
<string name="hud_locked">鎖定位置</string>
<string name="hud_locked_hint">拖曳 HUD 可移動位置;長按可鎖定或解鎖。</string>
<string name="hud_group_look">外觀</string>
<string name="hud_scale">螢幕顯示大小</string>
<string name="hud_color_soft">柔和</string>
<string name="hud_color_mid">適中</string>
<string name="hud_color_vivid">鮮豔</string>
<string name="hud_outline">描邊</string>
<string name="hud_outline_color">描邊顏色</string>
<string name="hud_outline_gray">灰色</string>
<string name="hud_outline_theme">主題色</string>
<string name="hud_group_metrics">讀數</string>
<string name="hud_metric_graph">幀時間圖表</string>
<string name="hud_metric_decimal">幀率顯示小數</string>
<string name="hud_metric_low001">0.01% 最低幀</string>
<string name="hud_metric_engine">圖形引擎</string>
<string name="hud_metric_gpu_model">GPU 名稱</string>
<string name="hud_metric_gpu">GPU 負載</string>
<string name="hud_metric_gpu_temp">GPU 溫度</string>
<string name="hud_metric_cpu">CPU 負載</string>
<string name="hud_metric_per_core">CPU 各核心</string>
<string name="hud_metric_temp">溫度</string>
<string name="hud_metric_ram">記憶體</string>
<string name="hud_metric_vram">顯示記憶體</string>
<string name="hud_metric_swap">交換空間</string>
<string name="hud_metric_battery">電池電量</string>
<string name="hud_metric_power">功耗</string>
<string name="hud_metric_network">網絡</string>
<string name="hud_metric_resolution">解像度</string>
<string name="hud_metric_proton">Proton 版本</string>
<string name="hud_metric_session">會話時長</string>
<string name="hud_metric_clock">時鐘</string>
<string name="hud_group_temps">溫度</string>
<string name="hud_temp_unit">單位</string>
<string name="hud_temp_bands">警告顏色</string>
<string name="hud_temp_bands_hint">溫度接近上限時會先變成琥珀色,再變成紅色。</string>
<string name="hud_temp_bands_off">關閉</string>
<string name="hud_temp_bands_auto">自動</string>
<string name="hud_temp_bands_manual">手動</string>
<string name="hud_temp_red_cpu">CPU 變紅溫度</string>
<string name="hud_temp_red_gpu">GPU 變紅溫度</string>
<string name="hud_temp_red_battery">電池變紅溫度</string>
<string name="hud_group_more">更多</string>
<string name="hud_export">HUD 診斷</string>
<string name="hud_export_hint">將 HUD 讀取的所有感應器報告儲存到 Downloads/DroidDeck。</string>
<string name="hud_export_button">儲存</string>
<string name="hud_export_done">已儲存到 %1$s</string>
<string name="hud_export_failed">無法儲存 HUD 報告。</string>
<string name="hud_reset">重設 HUD 設定</string>
<string name="hud_reset_button">重設</string>
<string name="hud_credit">FusionHUD,作者 The412Banner,github.com/The412Banner/FusionHUD (GPL-3.0)。</string>
<string name="drawer_scaling">縮放模式</string>
<string name="drawer_scaling_sharpness">縮放銳利度</string>
<string name="drawer_effects">畫面效果</string>
@@ -607,6 +607,65 @@
<string name="drawer_hud_color_amber">琥珀</string>
<string name="drawer_hud_color_violet">紫羅蘭</string>
<string name="drawer_hud_opacity">不透明度</string>
<string name="hud_matches_steam_overlay">幀率、幀時間和各項讀數與 Steam 效能疊加層來自相同的來源。</string>
<string name="hud_size">大小</string>
<string name="hud_size_hint">輕觸 HUD 也可以切換大小。</string>
<string name="hud_size_full">完整</string>
<string name="hud_size_tiles">圖塊</string>
<string name="hud_size_pill">膠囊</string>
<string name="hud_size_minimal">極簡</string>
<string name="hud_size_mega">超大</string>
<string name="hud_locked">鎖定位置</string>
<string name="hud_locked_hint">拖曳 HUD 可移動位置;長按可鎖定或解鎖。</string>
<string name="hud_group_look">外觀</string>
<string name="hud_scale">螢幕顯示大小</string>
<string name="hud_color_soft">柔和</string>
<string name="hud_color_mid">適中</string>
<string name="hud_color_vivid">鮮豔</string>
<string name="hud_outline">描邊</string>
<string name="hud_outline_color">描邊顏色</string>
<string name="hud_outline_gray">灰色</string>
<string name="hud_outline_theme">主題色</string>
<string name="hud_group_metrics">讀數</string>
<string name="hud_metric_graph">幀時間圖表</string>
<string name="hud_metric_decimal">幀率顯示小數</string>
<string name="hud_metric_low001">0.01% 最低幀</string>
<string name="hud_metric_engine">圖形引擎</string>
<string name="hud_metric_gpu_model">GPU 名稱</string>
<string name="hud_metric_gpu">GPU 負載</string>
<string name="hud_metric_gpu_temp">GPU 溫度</string>
<string name="hud_metric_cpu">CPU 負載</string>
<string name="hud_metric_per_core">CPU 各核心</string>
<string name="hud_metric_temp">溫度</string>
<string name="hud_metric_ram">記憶體</string>
<string name="hud_metric_vram">顯示記憶體</string>
<string name="hud_metric_swap">交換空間</string>
<string name="hud_metric_battery">電池電量</string>
<string name="hud_metric_power">功耗</string>
<string name="hud_metric_network">網路</string>
<string name="hud_metric_resolution">解析度</string>
<string name="hud_metric_proton">Proton 版本</string>
<string name="hud_metric_session">工作階段時間</string>
<string name="hud_metric_clock">時鐘</string>
<string name="hud_group_temps">溫度</string>
<string name="hud_temp_unit">單位</string>
<string name="hud_temp_bands">警告顏色</string>
<string name="hud_temp_bands_hint">溫度接近上限時會先變成琥珀色,再變成紅色。</string>
<string name="hud_temp_bands_off">關閉</string>
<string name="hud_temp_bands_auto">自動</string>
<string name="hud_temp_bands_manual">手動</string>
<string name="hud_temp_red_cpu">CPU 變紅溫度</string>
<string name="hud_temp_red_gpu">GPU 變紅溫度</string>
<string name="hud_temp_red_battery">電池變紅溫度</string>
<string name="hud_group_more">更多</string>
<string name="hud_export">HUD 診斷</string>
<string name="hud_export_hint">將 HUD 讀取的所有感測器報告儲存到 Downloads/DroidDeck。</string>
<string name="hud_export_button">儲存</string>
<string name="hud_export_done">已儲存到 %1$s</string>
<string name="hud_export_failed">無法儲存 HUD 報告。</string>
<string name="hud_reset">重設 HUD 設定</string>
<string name="hud_reset_button">重設</string>
<string name="hud_credit">FusionHUD,作者 The412Banner,github.com/The412Banner/FusionHUD (GPL-3.0)。</string>
<string name="drawer_scaling">縮放模式</string>
<string name="drawer_scaling_sharpness">縮放銳利度</string>
<string name="drawer_effects">畫面效果</string>
+93
View File
@@ -1,5 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="gog_maintenance">Manage GOG installation</string>
<string name="gog_check">Check for updates</string>
<string name="gog_repair">Verify/Repair</string>
<string name="gog_patches">Offline patches</string>
<string name="gog_refresh">Download full offline installer</string>
<string name="gog_update">Update to %1$s</string>
<string name="gog_resume">Resume GOG maintenance</string>
<string name="gog_open_patch">Open patch installer</string>
<string name="gog_patch_in_session">Finish or cancel the patch installer in the Linux session.</string>
<string name="gog_patch_requirements">Choose a patch for your installed version and language. Supported source versions may not be listed.</string>
<string name="gog_no_patches">GOG has no standalone Windows patches for this game.</string>
<string name="gog_managed_files">Modified game files may be replaced.</string>
<string name="gog_patch_installer_note">The installer opens in your Linux session.</string>
<string name="gog_download_label">Download</string>
<string name="gog_space_label">Extra space</string>
<string name="gog_space_estimate_label">Space estimate</string>
<string name="gog_repair_action">Repair files</string>
<string name="gog_refresh_action">Refresh installation</string>
<string name="gog_select_patch">Select</string>
<string name="glasses_experimental">Luma Ultra cameras — Experimental</string>
<string name="glasses_joycons">Joy-Con position tracking</string>
<string name="glasses_joycons_hint">Use the glasses cameras to position your paired Joy-Cons. Rotation and button inputs come from the Joy-Cons. Position is estimated when your wrists are hidden. Replaces bare-hand controllers and pauses phone-camera tracking. Point the Joy-Cons forward when connecting or recentering.</string>
@@ -647,6 +666,65 @@
<string name="drawer_hud_color_amber">Amber</string>
<string name="drawer_hud_color_violet">Violet</string>
<string name="drawer_hud_opacity">Opacity</string>
<string name="hud_matches_steam_overlay">Frame rate, frame times and readings come from the same sources as Steam\'s performance overlay.</string>
<string name="hud_size">Size</string>
<string name="hud_size_hint">Tapping the HUD also changes its size.</string>
<string name="hud_size_full">Full</string>
<string name="hud_size_tiles">Tiles</string>
<string name="hud_size_pill">Pill</string>
<string name="hud_size_minimal">Minimal</string>
<string name="hud_size_mega">Mega</string>
<string name="hud_locked">Lock in place</string>
<string name="hud_locked_hint">Drag the HUD to move it; a long press locks or unlocks it.</string>
<string name="hud_group_look">Look</string>
<string name="hud_scale">Size on screen</string>
<string name="hud_color_soft">Soft</string>
<string name="hud_color_mid">Medium</string>
<string name="hud_color_vivid">Vivid</string>
<string name="hud_outline">Outline</string>
<string name="hud_outline_color">Outline color</string>
<string name="hud_outline_gray">Gray</string>
<string name="hud_outline_theme">Theme color</string>
<string name="hud_group_metrics">Readings</string>
<string name="hud_metric_graph">Frame time graph</string>
<string name="hud_metric_decimal">Frame rate with a decimal</string>
<string name="hud_metric_low001">0.01% low</string>
<string name="hud_metric_engine">Graphics engine</string>
<string name="hud_metric_gpu_model">GPU name</string>
<string name="hud_metric_gpu">GPU load</string>
<string name="hud_metric_gpu_temp">GPU temperature</string>
<string name="hud_metric_cpu">CPU load</string>
<string name="hud_metric_per_core">CPU per core</string>
<string name="hud_metric_temp">Temperatures</string>
<string name="hud_metric_ram">Memory</string>
<string name="hud_metric_vram">Graphics memory</string>
<string name="hud_metric_swap">Swap</string>
<string name="hud_metric_battery">Battery level</string>
<string name="hud_metric_power">Power draw</string>
<string name="hud_metric_network">Network</string>
<string name="hud_metric_resolution">Resolution</string>
<string name="hud_metric_proton">Proton version</string>
<string name="hud_metric_session">Session time</string>
<string name="hud_metric_clock">Clock</string>
<string name="hud_group_temps">Temperatures</string>
<string name="hud_temp_unit">Unit</string>
<string name="hud_temp_bands">Warning colors</string>
<string name="hud_temp_bands_hint">Temperatures turn amber, then red, as they near the limit.</string>
<string name="hud_temp_bands_off">Off</string>
<string name="hud_temp_bands_auto">Automatic</string>
<string name="hud_temp_bands_manual">Manual</string>
<string name="hud_temp_red_cpu">CPU red at</string>
<string name="hud_temp_red_gpu">GPU red at</string>
<string name="hud_temp_red_battery">Battery red at</string>
<string name="hud_group_more">More</string>
<string name="hud_export">HUD diagnostics</string>
<string name="hud_export_hint">Saves a report of every sensor the HUD reads to Downloads/DroidDeck.</string>
<string name="hud_export_button">Save</string>
<string name="hud_export_done">Saved to %1$s</string>
<string name="hud_export_failed">Couldn\'t save the HUD report.</string>
<string name="hud_reset">Reset HUD settings</string>
<string name="hud_reset_button">Reset</string>
<string name="hud_credit">FusionHUD by The412Banner, github.com/The412Banner/FusionHUD (GPL-3.0).</string>
<string name="drawer_scaling">Scaling mode</string>
<string name="drawer_scaling_sharpness">Scaling sharpness</string>
<string name="drawer_effects">Screen effects</string>
@@ -997,6 +1075,8 @@
<string name="pairguide_build_number">In About phone, tap Build number 7 times</string>
<string name="pairguide_wireless">Turn on Wireless debugging</string>
<string name="pairguide_pair">Open Wireless debugging, then tap “Pair device with pairing code”</string>
<string name="pairguide_child_process">Turn on “Disable child process restrictions”</string>
<string name="pairguide_row_child_process">Disable child process restrictions</string>
<string name="pairguide_row_build_number">Build number</string>
<string name="pairguide_row_wireless">Wireless debugging</string>
<string name="pairguide_row_pair">Pair device with pairing code</string>
@@ -1314,6 +1394,9 @@
<string name="pip_not_ready">Picture in picture is available once the session is ready.</string>
<string name="pip_permission">Allow picture in picture for DroidDeck in Android settings.</string>
<string name="pip_unavailable">Android could not open picture in picture.</string>
<string name="game_more">More</string>
<string name="game_edit_art">Edit art</string>
<string name="stores_in_steam_label">In Steam</string>
<string name="game_shortcut">Shortcut</string>
<string name="game_shortcut_add">Add to home screen</string>
<string name="game_shortcut_choose">Choose game</string>
@@ -2225,6 +2308,11 @@
<string name="stores_resume">Resume</string>
<string name="stores_refresh">Refresh</string>
<string name="stores_sort">Sort</string>
<string name="library_display">Display</string>
<string name="library_display_larger">Larger cards</string>
<string name="library_display_smaller">Smaller cards</string>
<string name="library_display_title">Show title</string>
<string name="library_display_size">Show size</string>
<string name="stores_sort_last_played">Recently played</string>
<string name="stores_sort_recently_installed">Recently installed</string>
<string name="stores_sort_title_asc">Title A–Z</string>
@@ -2959,6 +3047,9 @@
<string name="storage_data_installed">Installed games</string>
<string name="storage_data_parts">Prefix %1$s · shaders %2$s · workshop %3$s</string>
<string name="storage_clear_shaders">Clear shaders</string>
<string name="storage_reset_prefix">Reset prefix</string>
<string name="storage_reset_prefix_title">Reset prefix for %1$s?</string>
<string name="storage_reset_prefix_confirm">Deletes its Wine prefix (%1$s) in %2$s and recreates it on the next launch. Saves, settings and installed redistributables inside it are lost; Steam Cloud saves stay in your account.</string>
<string name="storage_data_leftovers">Uninstalled games</string>
<string name="storage_steam_app">Steam app %1$d</string>
<string name="storage_leftover_unsure_detail">Its prefix still holds files, which can include local saves</string>
@@ -3320,4 +3411,6 @@
<string name="integration_shortcuts_service">DroidDeck Home button</string>
<string name="integration_shortcuts_service_description">Pass Home button presses to Steam Guide while a Steam session is focused and DroidDeck is the default Home app. Does not read screen content.</string>
<string name="integration_brightness_needed">Turn on Brightness in Setup → Steam integration</string>
<string name="gog_full_files">Native optimizations are unavailable. The download includes complete replacement files.</string>
<string name="gog_recover">Verify patch result</string>
</resources>
+3
View File
@@ -1,3 +1,5 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
@@ -186,6 +188,7 @@ dependencies = [
name = "droiddeckstores"
version = "0.1.0"
dependencies = [
"cc",
"flate2",
"futures-util",
"jni",
+3
View File
@@ -21,6 +21,9 @@ serde_json = { version = "1", features = ["preserve_order"] }
sha1 = "0.10"
sha2 = "0.10"
[build-dependencies]
cc = "1"
[profile.release]
codegen-units = 1
lto = "thin"
+11 -2
View File
@@ -77,14 +77,14 @@ after it (marker files, exe resolution, DLC markers, redist orchestration).
| `nativeCancel(handle: Long)` | `(J)V` | `Java_com_droiddeck_launcher_stores_gog_GogNative_nativeCancel` |
| `nativeRelease(handle: Long)` | `(J)V` | `Java_com_droiddeck_launcher_stores_gog_GogNative_nativeRelease` |
`nativeProbe()` always returns `1`; it exists so `isAvailable()` can catch `UnsatisfiedLinkError`
`nativeProbe()` returns `2`; it exists so `isAvailable()` can catch `UnsatisfiedLinkError`
once at startup instead of mid-download.
`nativeStart` parameters, in order:
| # | Parameter | Meaning |
|---|---|---|
| 1 | `kind: Int` | `0` = `KIND_GEN2_CHUNKS`, `1` = `KIND_GEN1_RANGES` (anything else → gen2) |
| 1 | `kind: Int` | `0` = `KIND_GEN2_CHUNKS`, `1` = `KIND_GEN1_RANGES`, `2` = GOG maintenance (anything else → gen2) |
| 2 | `depotManifests: Array<String>` | gen2: the inflated depot-manifest JSON strings, in fetch order, already filtered by product + language; gen1: the inflated build manifest (one element) |
| 3 | `cdnBases: Array<String>` | gen2: **every** CDN base of the secure-link answer — one per `urls[]` entry, each resolved the way `parseCdnUrl` resolves `urls[0]` today (query string intact), in GOG's order — or the one unauthenticated dependency store base (an array of one); gen1: `emptyArray()` (file URLs are in the manifest). Blank entries are ignored and a base whose host already appeared is dropped (the first wins). The fetch core spreads the window across the distinct hosts with a per-host cap of `max(6, ceil(maxWorkers / hosts))`, rotating a failed chunk to another CDN; one base behaves exactly like the old single `cdnBase`. The start log line lists them as `hosts=a,b,c`. |
| 4 | `installDir: String` | absolute install directory |
@@ -113,6 +113,15 @@ On-disk protocol (what a resumed run, by either engine, relies on): a file is as
`<file>.bhtmp`, then renamed over `<file>` once its size and MD5 match the manifest; an existing
`<file>` whose size+MD5 match is skipped. The engine writes nothing else.
Maintenance (`kind=2`) instead takes a single normalized plan in `depotManifests[0]`:
`files`, `oldFiles`, optional exact-build `patches`, per-product `links` and `patchLinks`,
and estimated `downloadBytes`. Credentials and these temporary links stay in memory.
It stages replacements under `.droiddeck-gog/stage`, revalidates completed chunks on
every run, and verifies each file before atomic replacement. `onBytes` counts actual
network bytes, including failed attempts. `onMaintenance(networkBytes, reusedBytes,
appliedBytes)` (`(JJJ)V`) reports the three separate cumulative counters. Existing
gen1/gen2 first-install progress semantics are unchanged.
## `com.droiddeck.launcher.stores.epic.EpicNative`
Everything Epic runs in the Rust `epic` module: the web-service calls (sign-in, refresh, exchange
Loaded 100 of 160 files, more files were not shown because too many files have changed in this diff. Show more