mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-05 04:25:38 +00:00
Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f244e284ad | ||
|
|
64950099a3 | ||
|
|
0516d023fa | ||
|
|
110cfc28f8 | ||
|
|
e871557bf2 | ||
|
|
a8b3c2d5dc | ||
|
|
87572a7f91 | ||
|
|
1e92d10fa5 | ||
|
|
92787dd0f0 |
No files matched your search
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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(×[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);
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -356,11 +408,12 @@ internal fun GameActions(
|
||||
) {
|
||||
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)
|
||||
@@ -521,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)) }
|
||||
}
|
||||
@@ -532,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)
|
||||
@@ -628,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
|
||||
@@ -644,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)
|
||||
}
|
||||
@@ -681,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))),
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -835,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))
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,8 @@ 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.*
|
||||
@@ -88,7 +90,10 @@ internal fun GogMaintenanceActions(game: InstalledStoreGame) {
|
||||
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 {
|
||||
SecondaryButton(stringResource(if (busy) R.string.common_checking else R.string.gog_maintenance), enabled = !busy && !active, modifier = Modifier.testTag("gog-maintenance")) { menu = !menu }
|
||||
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) }
|
||||
|
||||
@@ -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,6 +98,8 @@ 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
|
||||
@@ -147,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("")
|
||||
@@ -171,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) } }
|
||||
@@ -310,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(
|
||||
@@ -359,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
|
||||
@@ -383,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 }
|
||||
}
|
||||
}
|
||||
@@ -396,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,
|
||||
@@ -444,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) {
|
||||
@@ -463,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)
|
||||
@@ -472,6 +532,7 @@ private fun LibraryHeader(
|
||||
}
|
||||
},
|
||||
) {
|
||||
DisplayButton()
|
||||
if (showUninstalled != null || xbox) LibraryFilterButton(showUninstalled, onShowUninstalled, xbox)
|
||||
if (collections) CollectionsButton()
|
||||
SortButton(s, a)
|
||||
@@ -531,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)
|
||||
@@ -555,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)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -577,19 +689,27 @@ 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 && 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))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -765,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))
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -666,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>
|
||||
@@ -1335,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>
|
||||
@@ -2246,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>
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.droiddeck.launcher.glasses
|
||||
import java.nio.ByteBuffer
|
||||
import java.nio.ByteOrder
|
||||
import org.junit.After
|
||||
import org.junit.Before
|
||||
import org.junit.Assert.*
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -15,6 +16,8 @@ class SpatialControllerModeTest {
|
||||
private fun snapshot(): ByteBuffer = (SpatialTracking::class.java.getDeclaredField("buffer")
|
||||
.apply { isAccessible = true }.get(null) as ByteBuffer).duplicate().order(ByteOrder.LITTLE_ENDIAN)
|
||||
|
||||
@Before fun outputOnGlasses() = SpatialTracking.setOutputUsesGlasses(true)
|
||||
|
||||
@After fun cleanUp() {
|
||||
SpatialTracking.setSteadyHandAim(false)
|
||||
SpatialTracking.setControllers(false, false)
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
package com.droiddeck.launcher.hud
|
||||
|
||||
import org.junit.Assert.assertArrayEquals
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import kotlin.random.Random
|
||||
|
||||
class FrameStatsTest {
|
||||
/** MangoHud's update_hud_info_with_frametime and fps()/frame_timing(), line by line (overlay.cpp). */
|
||||
private class Mango {
|
||||
val frametimeData = ArrayList<Float>(List(200) { 0f })
|
||||
var lastPresentTime = 0L
|
||||
var lastFpsUpdate = 0L
|
||||
var framesSinceUpdate = 0L
|
||||
var fps = 0.0
|
||||
|
||||
fun update(frametimeNs: Long, now: Long) {
|
||||
val elapsed = now - lastFpsUpdate
|
||||
if (lastPresentTime != 0L) {
|
||||
frametimeData.add(frametimeNs / 1000000f)
|
||||
frametimeData.removeAt(0)
|
||||
}
|
||||
if (elapsed >= 500000000L) {
|
||||
fps = 1000000000.0 * framesSinceUpdate / elapsed
|
||||
framesSinceUpdate = 0
|
||||
lastFpsUpdate = now
|
||||
}
|
||||
lastPresentTime = now
|
||||
framesSinceUpdate++
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun readingsMatchMangoHudFrameByFrame() {
|
||||
val random = Random(7)
|
||||
val stats = FrameStats()
|
||||
val mango = Mango()
|
||||
var now = 5_000_000_000L
|
||||
val graph = FloatArray(FrameStats.GRAPH_FRAMES)
|
||||
repeat(20_000) { i ->
|
||||
val frametime = when {
|
||||
i % 977 == 0 -> 100_000_000L
|
||||
i % 131 == 0 -> 33_000_000L
|
||||
else -> 2_700_000L + random.nextLong(-400_000L, 400_000L)
|
||||
}
|
||||
now += frametime
|
||||
stats.add(frametime, now)
|
||||
mango.update(frametime, now)
|
||||
assertEquals("fps at frame $i", mango.fps.toFloat(), stats.fps, 0.0001f)
|
||||
assertEquals(1000f / maxOf(mango.fps.toFloat(), 1f), stats.frametimeMs(), 0.0001f)
|
||||
if (i % 499 == 0 || i < 210) {
|
||||
stats.graph(graph)
|
||||
assertArrayEquals("graph at frame $i", mango.frametimeData.toFloatArray(), graph, 0f)
|
||||
assertEquals(mango.frametimeData.min(), stats.graphMinMs(), 0f)
|
||||
assertEquals(mango.frametimeData.max(), stats.graphMaxMs(), 0f)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun compositorFramesWakeTheHudWhenGamescopeSharesNone() {
|
||||
val feed = GameFrameFeed(java.io.File("/nonexistent/droiddeck-hud/frames"))
|
||||
var now = 1_000_000_000L
|
||||
assertFalse(feed.poll(now))
|
||||
feed.onCompositorFrame(now)
|
||||
now += 16_666_667L
|
||||
feed.onCompositorFrame(now)
|
||||
assertTrue(feed.poll(now))
|
||||
assertFalse(feed.poll(now + 1))
|
||||
}
|
||||
|
||||
@Test fun aCompletedPeriodIsCountedWhenMangoHudWouldRedraw() {
|
||||
val stats = FrameStats()
|
||||
var now = 1_000_000_000L
|
||||
stats.add(10_000_000L, now)
|
||||
assertEquals(1L, stats.fpsUpdates)
|
||||
repeat(49) { now += 10_000_000L; stats.add(10_000_000L, now) }
|
||||
assertEquals(1L, stats.fpsUpdates)
|
||||
now += 10_000_000L; stats.add(10_000_000L, now)
|
||||
assertEquals(2L, stats.fpsUpdates)
|
||||
assertEquals(100f, stats.fps, 0.01f)
|
||||
}
|
||||
|
||||
@Test fun aSteadyRateReadsExactlyWithoutMillisecondRounding() {
|
||||
val stats = FrameStats()
|
||||
var now = 1_000_000_000L
|
||||
val frametime = 16_666_667L
|
||||
repeat(600) { now += frametime; stats.add(frametime, now) }
|
||||
assertEquals(60f, stats.fps, 0.01f)
|
||||
val lows = stats.lows(now)
|
||||
assertEquals(60f, lows.low1Fps, 0.01f)
|
||||
assertEquals(60f, lows.low01Fps, 0.01f)
|
||||
assertEquals(60f, stats.averageFps(), 0.01f)
|
||||
}
|
||||
|
||||
@Test fun stuttersShowInTheGraphAndTheLows() {
|
||||
val stats = FrameStats()
|
||||
var now = 1_000_000_000L
|
||||
repeat(1000) { i ->
|
||||
val frametime = if (i % 100 == 50) 100_000_000L else 2_700_000L
|
||||
now += frametime
|
||||
stats.add(frametime, now)
|
||||
}
|
||||
assertEquals(100f, stats.graphMaxMs(), 0.001f)
|
||||
assertEquals(2.7f, stats.graphMinMs(), 0.001f)
|
||||
assertEquals(10f, stats.lows(now).low01Fps, 0.01f)
|
||||
assertEquals(370.37f, stats.lows(now).low1Fps, 0.01f)
|
||||
}
|
||||
|
||||
@Test fun pausesStayOutOfTheAverageAndLowsButNotTheGraph() {
|
||||
val stats = FrameStats()
|
||||
var now = 1_000_000_000L
|
||||
repeat(300) { now += 10_000_000L; stats.add(10_000_000L, now) }
|
||||
now += 3_000_000_000L
|
||||
stats.add(3_000_000_000L, now)
|
||||
assertEquals(100f, stats.lows(now).low01Fps, 0.01f)
|
||||
assertEquals(3000f, stats.graphMaxMs(), 0.01f)
|
||||
}
|
||||
|
||||
@Test fun resetStartsOver() {
|
||||
val stats = FrameStats()
|
||||
var now = 1_000_000_000L
|
||||
repeat(300) { now += 10_000_000L; stats.add(10_000_000L, now) }
|
||||
stats.reset()
|
||||
assertEquals(0f, stats.fps, 0f)
|
||||
assertEquals(0f, stats.graphMaxMs(), 0f)
|
||||
assertEquals(FrameStats.Lows.EMPTY, stats.lows(now))
|
||||
}
|
||||
|
||||
@Test fun engineNamesFollowMangoHud() {
|
||||
assertEquals("DXVK", GameFrameFeed.engineLabel("DXVK"))
|
||||
assertEquals("VKD3D", GameFrameFeed.engineLabel("vkd3d"))
|
||||
assertEquals("ZINK", GameFrameFeed.engineLabel("mesa zink"))
|
||||
assertEquals("GAMESCOPE", GameFrameFeed.engineLabel("gamescope"))
|
||||
assertEquals("GAMESCOPE", GameFrameFeed.engineLabel(""))
|
||||
assertEquals("VULKAN", GameFrameFeed.engineLabel("UnityEngine"))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.droiddeck.launcher.hud
|
||||
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.Color
|
||||
import android.view.View
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.RuntimeEnvironment
|
||||
import org.robolectric.annotation.Config
|
||||
import org.robolectric.annotation.GraphicsMode
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.util.Base64
|
||||
import kotlin.math.roundToInt
|
||||
import kotlin.math.sqrt
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@Config(sdk = [33], qualifiers = "xhdpi")
|
||||
@GraphicsMode(GraphicsMode.Mode.NATIVE)
|
||||
class FusionHudPanelTest {
|
||||
@Test fun minimalIsTheSizeTheHudStartsWith() {
|
||||
assertEquals(FusionSize.MINIMAL, FusionSize.from(FusionHudConfig.DEFAULTS["hudSize"]))
|
||||
}
|
||||
|
||||
@Test fun everySizeDrawsTheDPanelWithEverythingInsideIt() {
|
||||
val stats = FrameStats()
|
||||
var now = 1_000_000_000L
|
||||
repeat(2_000) { i ->
|
||||
val frametime = if (i == 1_700) 25_600_000L else 2_850_000L
|
||||
now += frametime
|
||||
stats.add(frametime, now)
|
||||
}
|
||||
val snapshot = HudMetrics.Snapshot(64, 52, 3302, 1050, 89, 79, 10_800_000_000L, 16_000_000_000L, 67f,
|
||||
1_800_000_000L, HudMetrics.Battery(16f, false, 79, 34, null),
|
||||
intArrayOf(91, 91, 48, 50, 48, 19, 17, 73), intArrayOf(2265, 2265, 3148, 3148, 3148, 2956, 2956, 3302),
|
||||
2_700_000_000L, 6_400_000_000L, 31_000L, 9_000L)
|
||||
|
||||
for (size in FusionSize.values()) {
|
||||
val view = FusionHudView(RuntimeEnvironment.getApplication())
|
||||
view.applyConfig(FusionHudConfig.encode(FusionHudConfig.DEFAULTS + ("hudSize" to size.token)))
|
||||
view.setFrameStats(stats)
|
||||
view.showForTest(snapshot, "DXVK", now)
|
||||
val unspecified = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED)
|
||||
view.measure(unspecified, unspecified)
|
||||
view.layout(0, 0, view.measuredWidth, view.measuredHeight)
|
||||
val bitmap = Bitmap.createBitmap(view.width, view.height, Bitmap.Config.ARGB_8888)
|
||||
view.draw(Canvas(bitmap))
|
||||
|
||||
val png = ByteArrayOutputStream().also { bitmap.compress(Bitmap.CompressFormat.PNG, 100, it) }
|
||||
println("FUSIONHUD-${size.token.uppercase()}-PNG ${Base64.getEncoder().encodeToString(png.toByteArray())}")
|
||||
|
||||
val panel = view.panelForTest()!!
|
||||
assertTrue("$size panel inside the view",
|
||||
panel.left > 0f && panel.top > 0f && panel.right < view.width && panel.bottom < view.height)
|
||||
view.graphForTest()?.let { graph ->
|
||||
val r = view.panelRadiusForTest()
|
||||
val d = maxOf(panel.top + r - graph.top, graph.bottom - (panel.bottom - r), 0f)
|
||||
val edge = panel.right - r + sqrt(r * r - d * d)
|
||||
assertTrue("$size graph clears the round side", graph.right <= edge)
|
||||
}
|
||||
val orb = bitmap.getPixel(panel.left.roundToInt() + 1, panel.centerY().roundToInt())
|
||||
assertTrue("$size orb on the left side", Color.blue(orb) > 200 && Color.alpha(orb) > 200)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.droiddeck.launcher.hud
|
||||
|
||||
import org.junit.Assert.assertArrayEquals
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.junit.rules.TemporaryFolder
|
||||
import java.io.File
|
||||
|
||||
class MangoReadingsTest {
|
||||
@get:Rule val tmp = TemporaryFolder()
|
||||
|
||||
private fun readings() = MangoReadings(tmp.root, tmp.root)
|
||||
|
||||
@Test fun cpuLoadFollowsMangoHudsFormulaAndTruncates() {
|
||||
val stat = File(tmp.root, "stat")
|
||||
val m = readings()
|
||||
// user nice system idle iowait irq softirq steal guest guest_nice
|
||||
stat.writeText("cpu 1000 100 500 8000 400 50 50 0 200 0\ncpu0 500 50 250 4000 200 25 25 0 100 0\ncpu1 500 50 250 4000 200 25 25 0 100 0\nintr 0\n")
|
||||
m.cpu(stat)
|
||||
stat.writeText("cpu 1500 100 700 8600 500 60 70 10 300 0\ncpu0 900 50 400 4100 250 30 35 10 200 0\ncpu1 600 50 300 4500 250 30 35 0 100 0\nintr 0\n")
|
||||
val cpu = m.cpu(stat)!!
|
||||
// busy = user-guest 400 + nice 0 + system+irq+softirq 230 + steal 10 + guest 100 = 740 of 1440 (idle+iowait 700)
|
||||
assertEquals((740 * 100f / 1440).toInt(), cpu.percent)
|
||||
assertEquals(51, cpu.percent)
|
||||
assertArrayEquals(intArrayOf(((300 + 165 + 10 + 100) * 100f / (300 + 165 + 10 + 100 + 150)).toInt(), ((100 + 65) * 100f / (100 + 65 + 550)).toInt()), cpu.perCore)
|
||||
}
|
||||
|
||||
@Test fun anUnchangedCounterKeepsTheLastLoad() {
|
||||
val stat = File(tmp.root, "stat")
|
||||
val m = readings()
|
||||
stat.writeText("cpu 100 0 0 100 0 0 0 0 0 0\n")
|
||||
m.cpu(stat)
|
||||
stat.writeText("cpu 200 0 0 100 0 0 0 0 0 0\n")
|
||||
assertEquals(100, m.cpu(stat)!!.percent)
|
||||
assertEquals(100, m.cpu(stat)!!.percent)
|
||||
}
|
||||
|
||||
private fun battery(status: String, chargeNow: Long, chargeFull: Long, powerUw: Long) {
|
||||
val dir = File(tmp.root, "sys/power_supply/BAT1").apply { mkdirs() }
|
||||
File(dir, "status").writeText("$status\n")
|
||||
File(dir, "charge_now").writeText("$chargeNow\n")
|
||||
File(dir, "charge_full").writeText("$chargeFull\n")
|
||||
File(dir, "power_now").writeText("$powerUw\n")
|
||||
}
|
||||
|
||||
@Test fun batteryHidesWattsWhileChargingAsMangoHudDoes() {
|
||||
battery("Discharging", 3_622_942, 3_854_193, 8_760_000)
|
||||
val discharging = readings().battery()!!
|
||||
assertEquals(94, discharging.percent)
|
||||
assertEquals(8.76f, discharging.watts, 0.001f)
|
||||
assertFalse(discharging.charging)
|
||||
battery("Charging", 3_622_942, 3_854_193, 8_760_000)
|
||||
val charging = readings().battery()!!
|
||||
assertEquals(0f, charging.watts, 0f)
|
||||
assertTrue(charging.charging)
|
||||
}
|
||||
|
||||
@Test fun noBatteryFolderMeansNoReading() {
|
||||
assertNull(readings().battery())
|
||||
}
|
||||
|
||||
@Test fun gpuLoadIsTheLeadingNumber() {
|
||||
val f = File(tmp.root, "perf_now").apply { writeText(" 6 %\n") }
|
||||
assertEquals(6.0, MangoReadings.leadingNumber(f)!!, 0.0)
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.droiddeck.launcher.session
|
||||
|
||||
import org.junit.Assert.assertArrayEquals
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
|
||||
class PerfHudGraphTest {
|
||||
@Test fun theGraphShowsOnlyFramesFromThisHudRun() {
|
||||
val samples = floatArrayOf(9f, 9f, 9f, 9f, 9f, 16.7f, 33.4f, 16.6f)
|
||||
assertArrayEquals(floatArrayOf(16.7f, 33.4f, 16.6f), PerfHud.recent(samples, 105, 102), 0f)
|
||||
assertEquals(0, PerfHud.recent(samples, 103, 102).size)
|
||||
}
|
||||
|
||||
@Test fun anEarlySessionShowsWhatWasShownSoFar() {
|
||||
val samples = floatArrayOf(16.6f, 16.7f, 120f, 0f, 0f, 0f)
|
||||
assertArrayEquals(floatArrayOf(16.6f, 16.7f, 50f), PerfHud.recent(samples, 3, 0), 0f)
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,8 @@ class SettingsResetTest {
|
||||
SessionPrefs.setHudShowGraph(app, false)
|
||||
SessionPrefs.setHudColor(app, "amber")
|
||||
SessionPrefs.setHudOpacity(app, 40)
|
||||
SessionPrefs.setFusionHudConfig(app, "hudSize=mega,showFPSGraph=0")
|
||||
SessionPrefs.setFusionHudPosition(app, 120f, 40f)
|
||||
ControllerPrefs.setOpacity(app, 40)
|
||||
AppUiPrefs.setScale(app, 150)
|
||||
FrameGen.set(app, FrameGen.Mode(FrameGen.ENGINE_DDFG, 3))
|
||||
@@ -64,8 +66,8 @@ class SettingsResetTest {
|
||||
assertTrue(SessionPrefs.hudShowGraph(app))
|
||||
assertEquals(SessionPrefs.HUD_COLOR_MINT, SessionPrefs.hudColor(app))
|
||||
assertEquals(SessionPrefs.HUD_OPACITY_DEFAULT, SessionPrefs.hudOpacity(app))
|
||||
assertEquals("32.4°C", PerfHud.batteryCelsius(324))
|
||||
assertNull(PerfHud.batteryCelsius(0))
|
||||
assertNull(SessionPrefs.fusionHudConfig(app))
|
||||
assertNull(SessionPrefs.fusionHudPosition(app))
|
||||
assertEquals(100, ControllerPrefs.read(app).opacity)
|
||||
assertEquals(AppUiPrefs.DEFAULT_SCALE, AppUiPrefs.scale(app))
|
||||
assertEquals(FrameGen.Mode.OFF.engine, FrameGen.engine(app))
|
||||
|
||||
@@ -8,6 +8,7 @@ import org.robolectric.RuntimeEnvironment
|
||||
import org.robolectric.Shadows.shadowOf
|
||||
|
||||
fun createRobolectricComposeRule() = createComposeRule().also {
|
||||
RingVeil.reset()
|
||||
val context = RuntimeEnvironment.getApplication()
|
||||
shadowOf(context.packageManager).addActivityIfNotPresent(
|
||||
ComponentName(context, ComponentActivity::class.java),
|
||||
|
||||
@@ -19,7 +19,8 @@ class SessionDrawerPageTest {
|
||||
assertEquals(SessionDrawerPage.DISPLAY, connected.step(SessionDrawerPage.SECOND_SCREEN, 1))
|
||||
assertEquals(sessionDrawerPages(false), connected.filter { it != SessionDrawerPage.SECOND_SCREEN })
|
||||
for (pages in listOf(connected, sessionDrawerPages(false))) {
|
||||
assertEquals(SessionDrawerPage.EFFECTS, pages.step(SessionDrawerPage.DISPLAY, 1))
|
||||
assertEquals(SessionDrawerPage.HUD, pages.step(SessionDrawerPage.DISPLAY, 1))
|
||||
assertEquals(SessionDrawerPage.EFFECTS, pages.step(SessionDrawerPage.HUD, 1))
|
||||
assertEquals(SessionDrawerPage.VR, pages.step(SessionDrawerPage.EFFECTS, 1))
|
||||
assertEquals(SessionDrawerPage.GAMES, pages.step(SessionDrawerPage.VR, 1))
|
||||
assertEquals(SessionDrawerPage.SESSION, pages.step(SessionDrawerPage.GAMES, 1))
|
||||
|
||||
@@ -24,7 +24,8 @@ java_dir="${JAVA_HOME:-/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents
|
||||
[[ -x "$java_dir/bin/java" ]] || java_dir="${HOME}/.local/share/mise/installs/java/temurin-17"
|
||||
[[ "$java_dir" == */homebrew/* ]] && echo "using homebrew java path: $java_dir"
|
||||
[[ "$java_dir" == */mise/* ]] && echo "using mise java path: $java_dir"
|
||||
image_name=${DROIDDECK_BUILD_IMAGE:-droiddeck-local-cross:24.04-v3}
|
||||
. "${repo_root}/tools/docker_platform.sh"
|
||||
image_name=${DROIDDECK_BUILD_IMAGE}
|
||||
build_variant=${DROIDDECK_BUILD_VARIANT:-release}
|
||||
case "$build_variant" in
|
||||
debug) gradle_task=assembleDebug ;;
|
||||
@@ -113,7 +114,7 @@ image_id=$(docker image inspect --format '{{.Id}}' "${image_name}")
|
||||
rm -rf -- "${linuxfs_dir}"
|
||||
mkdir -p "${linuxfs_dir}"
|
||||
|
||||
docker run --rm --platform linux/amd64 \
|
||||
docker run --rm --platform "${docker_platform}" \
|
||||
--user "$(id -u):$(id -g)" \
|
||||
-v "${repo_root}:/src" -w /src "${image_name}" bash -lc '
|
||||
set -euo pipefail
|
||||
@@ -283,7 +284,7 @@ install -m644 "${mango_pkgs}/usr/bin/mangoapp" "${mango_dir}/mangoapp"
|
||||
for library in libfmt.so.10 libspdlog.so.1.13 libglfw.so.3 libtraceevent.so.1; do
|
||||
cp -L "${mango_pkgs}/usr/lib/${library}" "${mango_dir}/${library}"
|
||||
done
|
||||
docker run --rm --platform linux/amd64 --user "$(id -u):$(id -g)" -v "${repo_root}:/src" -w /src "${image_name}" \
|
||||
docker run --rm --platform "${docker_platform}" --user "$(id -u):$(id -g)" -v "${repo_root}:/src" -w /src "${image_name}" \
|
||||
aarch64-linux-gnu-gcc -shared -fPIC -O2 -Wall -Wl,-soname,libtracefs.so.1 \
|
||||
-o app/src/main/assets/linuxfs/usr/local/lib/mangoapp/libtracefs.so.1 tools/mangoapp/libtracefs-shim.c
|
||||
mkdir -p "${linuxfs_dir}/usr/local/bin"
|
||||
|
||||
@@ -1,14 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
repo=$(cd "$(dirname "$0")/../.." && pwd)
|
||||
image=${DROIDDECK_BUILD_IMAGE:-droiddeck-local-cross:24.04-v3}
|
||||
docker run --rm --platform linux/amd64 -v "$repo:/src" \
|
||||
-v "${HOME}/.cache/droiddeck-comet-rust:/rust" -w /src \
|
||||
. "$repo/tools/docker_platform.sh"
|
||||
image=${DROIDDECK_BUILD_IMAGE}
|
||||
platform=${DROIDDECK_DOCKER_PLATFORM}
|
||||
rust_cache="${HOME}/.cache/droiddeck-comet-rust${platform#linux/amd64}"
|
||||
rust_cache=${rust_cache/\/arm64/-arm64}
|
||||
docker run --rm --platform "$platform" -v "$repo:/src" \
|
||||
-v "${rust_cache}:/rust" -w /src \
|
||||
-e CARGO_HOME=/rust/cargo -e RUSTUP_HOME=/rust/rustup "$image" bash -lc '
|
||||
set -euo pipefail
|
||||
trap "chown -R '"$(id -u):$(id -g)"' app/build/comet app/src/main/assets/linuxfs/usr/local/lib/droiddeck-comet /rust 2>/dev/null || true" EXIT
|
||||
apt-get update -qq
|
||||
apt-get install -y -qq curl git unzip ca-certificates pkg-config >/dev/null
|
||||
git config --global --add safe.directory "*"
|
||||
export PATH=/rust/cargo/bin:$PATH
|
||||
if ! command -v cargo >/dev/null; then
|
||||
curl -fsSL https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain 1.90.0
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# Sourced by the build scripts: picks the Docker platform and the matching cross-build image.
|
||||
docker_platform=${DROIDDECK_DOCKER_PLATFORM:-}
|
||||
if [[ -z "${docker_platform}" ]]; then
|
||||
case "$(uname -m)" in arm64|aarch64) docker_platform=linux/arm64 ;; *) docker_platform=linux/amd64 ;; esac
|
||||
fi
|
||||
case "${docker_platform}" in linux/arm64|linux/arm64/*) docker_platform=linux/arm64 ;; esac
|
||||
if [[ -z "${DROIDDECK_BUILD_IMAGE:-}" ]]; then
|
||||
DROIDDECK_BUILD_IMAGE=droiddeck-local-cross:24.04-v3
|
||||
[[ "${docker_platform}" == linux/arm64 ]] && DROIDDECK_BUILD_IMAGE+=-arm64
|
||||
fi
|
||||
export DROIDDECK_DOCKER_PLATFORM=${docker_platform} DROIDDECK_BUILD_IMAGE
|
||||
@@ -1,4 +1,5 @@
|
||||
"""Check the engine before modifying build assets; never rebuild for a daemon error."""
|
||||
import os
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import sys
|
||||
@@ -20,5 +21,5 @@ if __name__ == '__main__':
|
||||
if 'No such image' not in image.stderr and 'image not known' not in image.stderr: # Docker, Podman
|
||||
sys.exit('Cannot inspect the build image: ' + image.stderr.strip())
|
||||
repo = Path(__file__).resolve().parents[1]
|
||||
subprocess.run(['docker', 'build', '--platform', 'linux/amd64', '-t', sys.argv[1],
|
||||
subprocess.run(['docker', 'build', '--platform', os.environ.get('DROIDDECK_DOCKER_PLATFORM', 'linux/amd64'), '-t', sys.argv[1],
|
||||
'-f', str(repo / 'tools/local-cross.Dockerfile'), str(repo)], check=True)
|
||||
@@ -199,3 +199,13 @@ is marked done at once - no duplicate fence, no epoll add or delete, no waiter w
|
||||
loop handles it in the same pass, after the import (FIFO commits still wait for a vblank). The
|
||||
`commit_ready_check` convar (default on, `gamescopectl commit_ready_check 0`) turns it off; the
|
||||
`xwm` log counts fences ready at import and waited for, every 10 s.
|
||||
|
||||
## 0125 steamcompmgr: share mangoapp's frame times with DroidDeck's HUD
|
||||
|
||||
DroidDeck's in-app HUD shows the same frame rate and frame times as Steam's performance overlay.
|
||||
DroidDeck's mangoapp (Valve's 20260902.1 build) reads the field at byte 16 of gamescope's messages as
|
||||
its frame time; gamescope 3.16.29 puts `app_frametime_ns` there, the time between signalled commits of
|
||||
the connector's windows (`mangoapp_nudge_app_frame`). With `DROIDDECK_HUD_FRAMES` set (droiddeck-session
|
||||
sets `/run/droiddeck-hud/frames`), gamescope maps that file and writes the same commits of connector 0,
|
||||
whether or not a mangoapp runs, plus the focused pid, output size, refresh, Steam focus and engine name.
|
||||
The layout is in the comment above `droiddeck_hud_frames_map`; the app reads it in `hudframes.c`.
|
||||
@@ -0,0 +1,227 @@
|
||||
diff --git a/src/commit.cpp b/src/commit.cpp
|
||||
index f2e0f0c..fbfb550 100644
|
||||
--- a/src/commit.cpp
|
||||
+++ b/src/commit.cpp
|
||||
@@ -86,6 +86,8 @@ void commit_t::Signal()
|
||||
mangoapp_nudge_app_frame( k_uMangoappLegacyMsgType, now );
|
||||
if ( m_uMangoMsgType != 0 )
|
||||
mangoapp_nudge_app_frame( m_uMangoMsgType, now );
|
||||
+ if ( m_bDroidDeckHudFrame )
|
||||
+ droiddeck_hud_app_frame( now );
|
||||
}
|
||||
|
||||
void commit_t::OnPollHangUp()
|
||||
@@ -113,7 +115,7 @@ bool commit_t::CloseFenceInternal()
|
||||
return true;
|
||||
}
|
||||
|
||||
-void commit_t::SetFence( int nFence, bool bMangoNudge, uint32_t uMangoMsgType, const std::shared_ptr<CommitDoneList_t> &pDoneCommits )
|
||||
+void commit_t::SetFence( int nFence, bool bMangoNudge, uint32_t uMangoMsgType, const std::shared_ptr<CommitDoneList_t> &pDoneCommits, bool bDroidDeckHudFrame )
|
||||
{
|
||||
std::unique_lock lock( m_WaitableCommitStateMutex );
|
||||
CloseFenceInternal();
|
||||
@@ -121,6 +123,7 @@ void commit_t::SetFence( int nFence, bool bMangoNudge, uint32_t uMangoMsgType, c
|
||||
m_nCommitFence = nFence;
|
||||
m_bMangoNudge = bMangoNudge;
|
||||
m_uMangoMsgType = uMangoMsgType;
|
||||
+ m_bDroidDeckHudFrame = bDroidDeckHudFrame;
|
||||
m_pDoneCommits = pDoneCommits;
|
||||
}
|
||||
|
||||
diff --git a/src/commit.h b/src/commit.h
|
||||
index 8603a9a..ae767b6 100644
|
||||
--- a/src/commit.h
|
||||
+++ b/src/commit.h
|
||||
@@ -35,7 +35,7 @@ struct commit_t final : public gamescope::RcObject, public gamescope::IWaitable,
|
||||
|
||||
// Returns true if we had a fence that was closed.
|
||||
bool CloseFenceInternal();
|
||||
- void SetFence( int nFence, bool bMangoNudge, uint32_t uMangoMsgType, const std::shared_ptr<CommitDoneList_t> &pDoneCommits );
|
||||
+ void SetFence( int nFence, bool bMangoNudge, uint32_t uMangoMsgType, const std::shared_ptr<CommitDoneList_t> &pDoneCommits, bool bDroidDeckHudFrame = false );
|
||||
|
||||
bool ShouldPreemptivelyUpscale( GamescopeUpscaleFilter eFilter, GamescopeUpscaleScaler eScaler );
|
||||
|
||||
@@ -82,5 +82,6 @@ struct commit_t final : public gamescope::RcObject, public gamescope::IWaitable,
|
||||
bool m_bMangoNudge = false;
|
||||
// Typed mangoapp stream to nudge, 0 for none, never the legacy type.
|
||||
uint32_t m_uMangoMsgType = 0;
|
||||
+ bool m_bDroidDeckHudFrame = false;
|
||||
std::shared_ptr<CommitDoneList_t> m_pDoneCommits; // I hate this
|
||||
};
|
||||
diff --git a/src/steamcompmgr.cpp b/src/steamcompmgr.cpp
|
||||
index 0aef598..1473148 100644
|
||||
--- a/src/steamcompmgr.cpp
|
||||
+++ b/src/steamcompmgr.cpp
|
||||
@@ -57,6 +57,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
+#include <sys/mman.h>
|
||||
#include <sys/poll.h>
|
||||
#include <sys/inotify.h>
|
||||
#include <sys/time.h>
|
||||
@@ -8359,6 +8360,8 @@ static TempUpscaleImage_t *GetTempUpscaleImage( global_focus_t *pFocus, uint32_t
|
||||
|
||||
gamescope::ConVar<bool> cv_surface_update_force_only_current_surface( "surface_update_force_only_current_surface", false, "Force updates to apply only to the current surface, ignoring commits for other surfaces." );
|
||||
|
||||
+static bool droiddeck_hud_frames_wanted();
|
||||
+
|
||||
gamescope::ConVar<bool> cv_commit_ready_check( "commit_ready_check", true, "Check a new commit's fence at import; a finished frame is marked done in the same pass instead of through the image waiter." );
|
||||
|
||||
// Set when update_wayland_res marks a commit done itself, so the main loop handles it in the same pass.
|
||||
@@ -8519,6 +8522,16 @@ void update_wayland_res(const std::shared_ptr<CommitDoneList_t> &doneCommits, st
|
||||
uMangoMsgType = pMangoFocus->externalOverlayWindow->uMangoappMsgType;
|
||||
}
|
||||
|
||||
+ // The commits the typed stream of connector 0 counts, whether or not a mangoapp runs.
|
||||
+ bool bDroidDeckHudFrame = false;
|
||||
+ if ( pUpscaleFocus && !w->isSteamStreamingClient )
|
||||
+ bDroidDeckHudFrame = pUpscaleFocus->ulVirtualFocusKey == 0;
|
||||
+ else if ( w->isSteamStreamingClientVideo )
|
||||
+ {
|
||||
+ auto iter = g_VirtualConnectorFocuses.find( 0 );
|
||||
+ bDroidDeckHudFrame = iter != g_VirtualConnectorFocuses.end() && iter->second.focusWindow && iter->second.focusWindow->isSteamStreamingClient;
|
||||
+ }
|
||||
+
|
||||
bool bValidPreemptiveScale = reslistentry.pAcquirePoint && pUpscaleFocus && cv_upscale_preemptive;
|
||||
bool bPreemptiveUpscale = bValidPreemptiveScale && newCommit->ShouldPreemptivelyUpscale( pUpscaleFocus->eUpscaleFilter, pUpscaleFocus->eUpscaleScaler );
|
||||
|
||||
@@ -8650,7 +8663,7 @@ void update_wayland_res(const std::shared_ptr<CommitDoneList_t> &doneCommits, st
|
||||
|
||||
gpuvis_trace_printf( "pushing wait for commit %lu win %lx", newCommit->commitID, w->type == steamcompmgr_win_type_t::XWAYLAND ? w->xwayland().id : 0 );
|
||||
{
|
||||
- newCommit->SetFence( fence, mango_nudge, uMangoMsgType, doneCommits );
|
||||
+ newCommit->SetFence( fence, mango_nudge, uMangoMsgType, doneCommits, bDroidDeckHudFrame && droiddeck_hud_frames_wanted() );
|
||||
if ( bKnownReady )
|
||||
{
|
||||
newCommit->Signal();
|
||||
@@ -9865,6 +9878,109 @@ static void publish_mangoapp_connector_snapshots()
|
||||
}
|
||||
}
|
||||
|
||||
+// DroidDeck's own HUD reads the frame times DroidDeck's mangoapp shows from a shared file named by
|
||||
+// DROIDDECK_HUD_FRAMES, also while no mangoapp runs. That mangoapp (Valve's 20260902.1 build) reads the
|
||||
+// field at byte 16 of each message as its frame time, which is app_frametime_ns here: one time per
|
||||
+// signalled commit of the connector's windows (mangoapp_nudge_app_frame). The file gets the same commits
|
||||
+// of connector 0. Little-endian: 0 magic, 4 version, 8 capacity, 12 pid, 16 frames written (u64),
|
||||
+// 24 info sequence (odd while the info is written), 28 output width, 32 height, 36 refresh mHz, 40 Steam
|
||||
+// focused, 44 engine (40 bytes), then from 128 one { frametime ns, monotonic time ns } pair per frame,
|
||||
+// a ring of capacity.
|
||||
+static constexpr uint32_t k_uDroidDeckHudFramesMagic = 0x46484444;
|
||||
+static constexpr uint32_t k_uDroidDeckHudFramesVersion = 1;
|
||||
+static constexpr uint32_t k_uDroidDeckHudFramesCapacity = 1024;
|
||||
+static constexpr size_t k_zDroidDeckHudFramesHeader = 128;
|
||||
+static constexpr size_t k_zDroidDeckHudFramesSize = k_zDroidDeckHudFramesHeader + k_uDroidDeckHudFramesCapacity * 16;
|
||||
+static std::mutex s_DroidDeckHudFramesMutex;
|
||||
+
|
||||
+static uint8_t *droiddeck_hud_frames_map()
|
||||
+{
|
||||
+ static uint8_t *s_pMap = nullptr;
|
||||
+ static bool s_bTried = false;
|
||||
+ if ( s_bTried )
|
||||
+ return s_pMap;
|
||||
+ s_bTried = true;
|
||||
+
|
||||
+ const char *pszPath = getenv( "DROIDDECK_HUD_FRAMES" );
|
||||
+ if ( !pszPath || !*pszPath )
|
||||
+ return nullptr;
|
||||
+ int fd = open( pszPath, O_RDWR | O_CREAT | O_CLOEXEC, 0644 );
|
||||
+ if ( fd < 0 )
|
||||
+ {
|
||||
+ xwm_log.errorf_errno( "DroidDeck HUD frames: open %s", pszPath );
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+ void *pMap = MAP_FAILED;
|
||||
+ if ( ftruncate( fd, k_zDroidDeckHudFramesSize ) == 0 )
|
||||
+ pMap = mmap( nullptr, k_zDroidDeckHudFramesSize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0 );
|
||||
+ close( fd );
|
||||
+ if ( pMap == MAP_FAILED )
|
||||
+ {
|
||||
+ xwm_log.errorf_errno( "DroidDeck HUD frames: map %s", pszPath );
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+ uint8_t *pBytes = static_cast<uint8_t *>( pMap );
|
||||
+ __atomic_store_n( reinterpret_cast<uint32_t *>( pBytes ), 0u, __ATOMIC_RELEASE );
|
||||
+ memset( pBytes + 4, 0, k_zDroidDeckHudFramesSize - 4 );
|
||||
+ memcpy( pBytes + 4, &k_uDroidDeckHudFramesVersion, 4 );
|
||||
+ memcpy( pBytes + 8, &k_uDroidDeckHudFramesCapacity, 4 );
|
||||
+ __atomic_store_n( reinterpret_cast<uint32_t *>( pBytes ), k_uDroidDeckHudFramesMagic, __ATOMIC_RELEASE );
|
||||
+ xwm_log.infof( "DroidDeck HUD frames: %s", pszPath );
|
||||
+ s_pMap = pBytes;
|
||||
+ return s_pMap;
|
||||
+}
|
||||
+
|
||||
+static bool droiddeck_hud_frames_wanted()
|
||||
+{
|
||||
+ std::unique_lock lock( s_DroidDeckHudFramesMutex );
|
||||
+ return droiddeck_hud_frames_map() != nullptr;
|
||||
+}
|
||||
+
|
||||
+// Signal() runs on the image waiter thread or, for a frame finished at import, on steamcompmgr's.
|
||||
+void droiddeck_hud_app_frame( uint64_t ulNow )
|
||||
+{
|
||||
+ std::unique_lock lock( s_DroidDeckHudFramesMutex );
|
||||
+ uint8_t *pMap = droiddeck_hud_frames_map();
|
||||
+ if ( !pMap )
|
||||
+ return;
|
||||
+ static uint64_t s_ulLastFrame = 0;
|
||||
+ uint64_t ulLast = s_ulLastFrame;
|
||||
+ s_ulLastFrame = ulNow;
|
||||
+ if ( !ulLast || ulNow <= ulLast )
|
||||
+ return;
|
||||
+ uint64_t *pCount = reinterpret_cast<uint64_t *>( pMap + 16 );
|
||||
+ uint64_t ulCount = __atomic_load_n( pCount, __ATOMIC_RELAXED );
|
||||
+ uint64_t ulFrame[2] = { ulNow - ulLast, ulNow };
|
||||
+ memcpy( pMap + k_zDroidDeckHudFramesHeader + ( ulCount % k_uDroidDeckHudFramesCapacity ) * 16, ulFrame, sizeof( ulFrame ) );
|
||||
+ __atomic_store_n( pCount, ulCount + 1, __ATOMIC_RELEASE );
|
||||
+}
|
||||
+
|
||||
+static void publish_droiddeck_hud_info()
|
||||
+{
|
||||
+ std::unique_lock lock( s_DroidDeckHudFramesMutex );
|
||||
+ uint8_t *pMap = droiddeck_hud_frames_map();
|
||||
+ if ( !pMap )
|
||||
+ return;
|
||||
+ auto focusIter = g_VirtualConnectorFocuses.find( 0 );
|
||||
+ global_focus_t *pFocus = focusIter != g_VirtualConnectorFocuses.end() ? &focusIter->second : GetCurrentFocus();
|
||||
+ if ( !pFocus )
|
||||
+ return;
|
||||
+
|
||||
+ uint32_t *pSeq = reinterpret_cast<uint32_t *>( pMap + 24 );
|
||||
+ uint32_t uSeq = __atomic_load_n( pSeq, __ATOMIC_RELAXED );
|
||||
+ __atomic_store_n( pSeq, uSeq + 1, __ATOMIC_RELAXED );
|
||||
+ __atomic_thread_fence( __ATOMIC_RELEASE );
|
||||
+ uint32_t uPid = uint32_t( pFocus->nFocusWindowPid );
|
||||
+ uint32_t uOutput[4] = { g_nOutputWidth, g_nOutputHeight, uint32_t( g_nOutputRefresh ), window_is_steam( pFocus->inputFocusWindow ) ? 1u : 0u };
|
||||
+ char szEngine[40] = {};
|
||||
+ if ( pFocus->pFocusWindowEngine )
|
||||
+ pFocus->pFocusWindowEngine->copy( szEngine, sizeof( szEngine ) - 1 );
|
||||
+ memcpy( pMap + 12, &uPid, 4 );
|
||||
+ memcpy( pMap + 28, uOutput, sizeof( uOutput ) );
|
||||
+ memcpy( pMap + 44, szEngine, sizeof( szEngine ) );
|
||||
+ __atomic_store_n( pSeq, uSeq + 2, __ATOMIC_RELEASE );
|
||||
+}
|
||||
+
|
||||
// mangohudctl posts one control message for every instance to act on.
|
||||
static void relay_mangoapp_control()
|
||||
{
|
||||
@@ -10843,6 +10959,7 @@ steamcompmgr_main(int argc, char **argv)
|
||||
|
||||
publish_mangoapp_snapshot();
|
||||
publish_mangoapp_connector_snapshots();
|
||||
+ publish_droiddeck_hud_info();
|
||||
relay_mangoapp_control();
|
||||
|
||||
if ( bIsVBlankFromTimer )
|
||||
diff --git a/src/steamcompmgr.hpp b/src/steamcompmgr.hpp
|
||||
index bd62fd1..7a7119f 100644
|
||||
--- a/src/steamcompmgr.hpp
|
||||
+++ b/src/steamcompmgr.hpp
|
||||
@@ -173,6 +173,7 @@ static constexpr uint32_t MangoappControlMsgType( uint32_t uMsgType )
|
||||
static_assert( MangoappControlMsgType( k_uMangoappLegacyMsgType ) == k_uMangoappControlMsgType );
|
||||
|
||||
extern void mangoapp_update( uint64_t visible_frametime, uint64_t app_frametime_ns, uint64_t latency_ns, uint32_t uMsgType = k_uMangoappLegacyMsgType );
|
||||
+extern void droiddeck_hud_app_frame( uint64_t ulNow );
|
||||
extern void mangoapp_nudge_app_frame( uint32_t uMsgType, uint64_t ulNow );
|
||||
extern void mangoapp_set_connector_snapshots( std::unordered_map<uint32_t, MangoappSnapshot_t> snapshots );
|
||||
extern void mangoapp_drop_stream( uint32_t uMsgType );
|
||||
@@ -1,3 +1,3 @@
|
||||
GAMESCOPE_REPO=Droid-Deck/DroidDeck-Components
|
||||
GAMESCOPE_TAG=gamescope-3.16.29-p18
|
||||
GAMESCOPE_SHA256=a79d8acc5628973c807a43524638c20e7d5c101a4fc3bcb8b5068631e6f6fe55
|
||||
GAMESCOPE_TAG=gamescope-3.16.29-p19
|
||||
GAMESCOPE_SHA256=e7333c6a2b95708b199c2c5bd0973e3f0e711e2dc746950cc648c2515ea2926b
|
||||
@@ -257,6 +257,8 @@ if [ -z "${BL_INSIDE:-}" ]; then
|
||||
args+=(--mangoapp)
|
||||
echo "== gamescope: mangoapp on ($(command -v mangoapp), config $MANGOHUD_CONFIGFILE)"
|
||||
fi
|
||||
# gamescope writes the frame times the app's HUD shows here (patch 0125).
|
||||
mkdir -p /run/droiddeck-hud && export DROIDDECK_HUD_FRAMES=/run/droiddeck-hud/frames
|
||||
export BL_INSIDE=1
|
||||
# A fixed path: left to itself gamescope creates a new limiter state file on every start.
|
||||
rm -f "${XDG_RUNTIME_DIR:-/tmp}"/gamescope-limiter-*
|
||||
|
||||
@@ -3,16 +3,12 @@ FROM ubuntu:24.04
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y \
|
||||
binutils \
|
||||
binutils-aarch64-linux-gnu \
|
||||
gcc \
|
||||
g++ \
|
||||
gcc-aarch64-linux-gnu \
|
||||
g++-aarch64-linux-gnu \
|
||||
python3 \
|
||||
zstd \
|
||||
unzip \
|
||||
&& apt-get install -y binutils gcc g++ python3 zstd unzip \
|
||||
&& if [ "$(uname -m)" = aarch64 ]; then \
|
||||
for tool in gcc g++ strip readelf objdump ar; do ln -s "$(command -v $tool)" /usr/local/bin/aarch64-linux-gnu-$tool; done; \
|
||||
else \
|
||||
apt-get install -y binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu g++-aarch64-linux-gnu; \
|
||||
fi \
|
||||
&& mkdir -p /src
|
||||
|
||||
WORKDIR /src
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
# Kotlin/resource-only loop: reuses the assets build_local.sh already prepared, then signs and installs.
|
||||
set -euo pipefail
|
||||
repo_root=$(CDPATH= cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)
|
||||
cd "${repo_root}"
|
||||
sdk_dir=${ANDROID_HOME:-${ANDROID_SDK_ROOT:-"${HOME}/Library/Android/sdk"}}
|
||||
export ANDROID_HOME=${sdk_dir} ANDROID_SDK_ROOT=${sdk_dir}
|
||||
export JAVA_HOME=${JAVA_HOME:-/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home}
|
||||
out=${1:-"${TMPDIR:-/tmp}/droiddeck-quick-signed.apk"}
|
||||
|
||||
signing_env=${DROIDDECK_SIGNING_ENV:-}
|
||||
if [[ -z "${signing_env}" ]]; then
|
||||
for candidate in "${repo_root}/.signing.env" \
|
||||
"$(dirname "$(git -C "${repo_root}" rev-parse --path-format=absolute --git-common-dir 2>/dev/null || echo .)")/.signing.env"; do
|
||||
[[ -f "${candidate}" ]] && { signing_env=${candidate}; break; }
|
||||
done
|
||||
fi
|
||||
[[ -f "${signing_env}" ]] || { echo "No signing env found; set DROIDDECK_SIGNING_ENV or add .signing.env." >&2; exit 1; }
|
||||
|
||||
build_tools=
|
||||
while IFS= read -r dir; do
|
||||
[[ -x "${dir}/aapt" && -x "${dir}/zipalign" && -x "${dir}/apksigner" ]] && { build_tools=${dir}; break; }
|
||||
done < <(ls -d "${sdk_dir}"/build-tools/* 2>/dev/null | sort -rV)
|
||||
[[ -n "${build_tools}" ]] || { echo "No build-tools with aapt, zipalign and apksigner under ${sdk_dir}." >&2; exit 1; }
|
||||
|
||||
./gradlew -q :app:assembleRelease
|
||||
(
|
||||
cd "$(dirname "${signing_env}")"
|
||||
set -a; . "${signing_env}"; set +a
|
||||
BUILD_TOOLS=${build_tools} "${repo_root}/tools/release/sign-apk.sh" \
|
||||
"${repo_root}/app/build/outputs/apk/release/app-release.apk" standard "${out}" | tail -1
|
||||
)
|
||||
"${repo_root}/tools/deploy_local.sh" "${out}" | tail -2
|
||||
+3
-2
@@ -5,7 +5,8 @@ cd "$repo_root"
|
||||
if [[ $(uname -s) == Linux ]]; then
|
||||
exec python3 -m unittest discover -s tools/tests "$@"
|
||||
fi
|
||||
image=${DROIDDECK_BUILD_IMAGE:-droiddeck-local-cross:24.04-v3}
|
||||
. "${repo_root}/tools/docker_platform.sh"
|
||||
image=${DROIDDECK_BUILD_IMAGE}
|
||||
python3 tools/docker_preflight.py "$image"
|
||||
exec docker run --rm --platform linux/amd64 --user "$(id -u):$(id -g)" \
|
||||
exec docker run --rm --platform "${DROIDDECK_DOCKER_PLATFORM}" --user "$(id -u):$(id -g)" \
|
||||
-v "$repo_root:/src:ro" -w /src "$image" python3 -m unittest discover -s tools/tests "$@"
|
||||
@@ -0,0 +1,136 @@
|
||||
from pathlib import Path
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
PATCH = ROOT / "tools/gamescope/patches/0125-droiddeck-hud-frame-times.patch"
|
||||
READER = ROOT / "app/src/main/cpp/waylandcomp/src/hudframes.c"
|
||||
|
||||
|
||||
def patch_writer():
|
||||
added = [line[1:] for line in PATCH.read_text().splitlines() if line.startswith("+") and not line.startswith("+++")]
|
||||
text = "\n".join(added)
|
||||
start = text.index("// DroidDeck's own HUD reads")
|
||||
end = text.index("\n}\n", text.index("static void publish_droiddeck_hud_info()", start)) + 3
|
||||
return text[start:end]
|
||||
|
||||
|
||||
PREAMBLE = r'''
|
||||
#include <assert.h>
|
||||
#include <cstdarg>
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <fcntl.h>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <sys/mman.h>
|
||||
#include <unistd.h>
|
||||
#include <unordered_map>
|
||||
|
||||
extern "C" {
|
||||
#include "hudframes.h"
|
||||
}
|
||||
|
||||
struct steamcompmgr_win_t { int appID; };
|
||||
struct global_focus_t {
|
||||
uint64_t ulBasePlaneCommitID = 0;
|
||||
pid_t nFocusWindowPid = 0;
|
||||
std::shared_ptr<std::string> pFocusWindowEngine;
|
||||
steamcompmgr_win_t *inputFocusWindow = nullptr;
|
||||
};
|
||||
static std::unordered_map<uint64_t, global_focus_t> g_VirtualConnectorFocuses;
|
||||
static global_focus_t *GetCurrentFocus() { return nullptr; }
|
||||
static bool window_is_steam(steamcompmgr_win_t *w) { return w && w->appID == 769; }
|
||||
static uint64_t g_now = 1000000000ull;
|
||||
static uint64_t get_time_in_nanos() { return g_now; }
|
||||
static uint32_t g_nOutputWidth = 1280, g_nOutputHeight = 720;
|
||||
static int g_nOutputRefresh = 144000;
|
||||
struct Log {
|
||||
void infof(const char *, ...) {}
|
||||
void errorf_errno(const char *fmt, ...) { va_list a; va_start(a, fmt); vfprintf(stderr, fmt, a); va_end(a); }
|
||||
} xwm_log;
|
||||
'''
|
||||
|
||||
MAIN = r'''
|
||||
static void frame(uint64_t step) { g_now += step; droiddeck_hud_app_frame(g_now); }
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
setenv("DROIDDECK_HUD_FRAMES", argv[1], 1);
|
||||
assert(droiddeck_hud_frames_wanted());
|
||||
global_focus_t &focus = g_VirtualConnectorFocuses[0];
|
||||
focus.nFocusWindowPid = 4242;
|
||||
focus.pFocusWindowEngine = std::make_shared<std::string>("DXVK");
|
||||
steamcompmgr_win_t game{ 12345 };
|
||||
focus.inputFocusWindow = &game;
|
||||
publish_droiddeck_hud_info();
|
||||
|
||||
droiddeck_hud_app_frame(g_now);
|
||||
struct hud_frames *h = hud_frames_open(argv[1]);
|
||||
assert(h);
|
||||
int64_t ft[2048], tm[2048];
|
||||
assert(hud_frames_poll(h, ft, tm, 2048) == 0);
|
||||
|
||||
const uint64_t steps[] = { 2700000, 2800000, 41600000, 6944000 };
|
||||
for (uint64_t step : steps) frame(step);
|
||||
int n = hud_frames_poll(h, ft, tm, 2048);
|
||||
assert(n == 4);
|
||||
for (int i = 0; i < 4; i++) assert((uint64_t)ft[i] == steps[i]);
|
||||
assert((uint64_t)tm[3] == g_now);
|
||||
assert(hud_frames_poll(h, ft, tm, 2048) == 0);
|
||||
|
||||
int32_t info[5];
|
||||
char engine[41];
|
||||
assert(hud_frames_info(h, info, engine, sizeof(engine)));
|
||||
assert(info[0] == 4242 && info[1] == 1280 && info[2] == 720 && info[3] == 144000 && info[4] == 0);
|
||||
assert(strcmp(engine, "DXVK") == 0);
|
||||
game.appID = 769;
|
||||
publish_droiddeck_hud_info();
|
||||
assert(hud_frames_info(h, info, engine, sizeof(engine)) && info[4] == 1);
|
||||
|
||||
for (int i = 0; i < 3000; i++) frame(1000000 + i);
|
||||
n = hud_frames_poll(h, ft, tm, 2048);
|
||||
assert(n == 1024);
|
||||
assert(ft[1023] == 1000000 + 2999);
|
||||
assert(ft[0] == 1000000 + 2999 - 1023);
|
||||
|
||||
for (int i = 0; i < 10; i++) frame(2000000);
|
||||
assert(hud_frames_poll(h, ft, tm, 4) == 4 && ft[3] == 2000000);
|
||||
hud_frames_close(h);
|
||||
puts("ok");
|
||||
return 0;
|
||||
}
|
||||
'''
|
||||
|
||||
|
||||
@unittest.skipUnless(shutil.which("cc") and shutil.which("c++"), "needs a C and C++ compiler")
|
||||
class HudFramesTest(unittest.TestCase):
|
||||
def test_gamescope_writer_and_app_reader_agree(self):
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
tmp = Path(tmp)
|
||||
source = tmp / "writer.cpp"
|
||||
source.write_text(PREAMBLE + patch_writer() + MAIN)
|
||||
include = READER.parent
|
||||
subprocess.run(["cc", "-std=gnu11", "-Wall", "-Wextra", "-Werror", "-c", str(READER), "-o", str(tmp / "reader.o")], check=True)
|
||||
subprocess.run(["c++", "-std=c++20", "-Wall", "-Werror", "-Wno-unused-function", f"-I{include}", str(source), str(tmp / "reader.o"),
|
||||
"-o", str(tmp / "hudframes")], check=True)
|
||||
result = subprocess.run([str(tmp / "hudframes"), str(tmp / "frames")], capture_output=True, text=True)
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
self.assertEqual(result.stdout.strip(), "ok")
|
||||
self.assertEqual(os.path.getsize(tmp / "frames"), 128 + 1024 * 16)
|
||||
|
||||
def test_session_points_gamescope_at_the_file_the_app_reads(self):
|
||||
session = (ROOT / "tools/linuxfs/overlay/usr/local/bin/droiddeck-session").read_text()
|
||||
self.assertIn("export DROIDDECK_HUD_FRAMES=/run/droiddeck-hud/frames", session)
|
||||
app = (ROOT / "app/src/main/java/com/droiddeck/launcher/hud/HudFrames.kt").read_text()
|
||||
self.assertIn('"run/droiddeck-hud/frames"', app)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
+2
-1
@@ -2,6 +2,7 @@
|
||||
set -euo pipefail
|
||||
here=$(cd "$(dirname "$0")" && pwd)
|
||||
repo=$(cd "$here/../.." && pwd)
|
||||
. "$repo/tools/docker_platform.sh"
|
||||
|
||||
native=0
|
||||
if [ "${1:-}" = --native ]; then native=1; shift; fi
|
||||
@@ -87,7 +88,7 @@ compile() {
|
||||
if [ "$native" = 1 ]; then
|
||||
(cd "$repo" && "${cmd[@]}")
|
||||
else
|
||||
docker run --rm --platform linux/amd64 --user "$(id -u):$(id -g)" -v "$repo:/src" -w /src \
|
||||
docker run --rm --platform "${DROIDDECK_DOCKER_PLATFORM:-linux/amd64}" --user "$(id -u):$(id -g)" -v "$repo:/src" -w /src \
|
||||
"${DROIDDECK_BUILD_IMAGE:-droiddeck-local-cross:24.04-v3}" "${cmd[@]}"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"schema": 1,
|
||||
"version": "0.2.8",
|
||||
"version": "0.2.12",
|
||||
"repository": "https://github.com/xodus-gaming/xodus.git",
|
||||
"commit": "53ea781dcd073e31d7ea68e894134e9c959bff04",
|
||||
"rust": "1.99.0",
|
||||
"cargoLockSha256": "2259b343e00dadc263018beb7664b12e9d58a0b73bff502ad566f5f8619ce28a",
|
||||
"patchId": "linux-run-v24",
|
||||
"compatibility": "linux-run-v18",
|
||||
"patchId": "linux-run-v54",
|
||||
"compatibility": "linux-run-v25",
|
||||
"patches": [
|
||||
{
|
||||
"file": "xodus-linux-run.patch",
|
||||
@@ -70,7 +70,7 @@
|
||||
},
|
||||
{
|
||||
"file": "xodus-package-selection.patch",
|
||||
"sha256": "7507cb0535cd914d3607e7940d5e17b949d106d0b89c139b84372a1ee1732c54"
|
||||
"sha256": "28a2b566afdc1a572cd5ec52027fb48cc1823a25e8f304f282d9bf61e8d46463"
|
||||
},
|
||||
{
|
||||
"file": "xodus-package-metadata.patch",
|
||||
@@ -103,7 +103,119 @@
|
||||
{
|
||||
"file": "xodus-content-response.patch",
|
||||
"sha256": "e9997951526cfa08e3dd8c5fc4c383bf630e7ab8992d9e211acee40fdc6422a4"
|
||||
},
|
||||
{
|
||||
"file": "xodus-streaming-recovery.patch",
|
||||
"sha256": "7e8550d7b50faf3b3cb7cfcf6e47cff35a0369737d421ef454d4dcf0c9c8ffad"
|
||||
},
|
||||
{
|
||||
"file": "xodus-download-bandwidth.patch",
|
||||
"sha256": "4655c51eb93811ea41500be05062a4ff0f64dde3d819dddde12e48d91b075293"
|
||||
},
|
||||
{
|
||||
"file": "xodus-ticket-diagnostics.patch",
|
||||
"sha256": "6559c77e06f3c7f29caac95ed979b7644bd4082f9ff777f66713888969c3905e"
|
||||
},
|
||||
{
|
||||
"file": "xodus-auth-consistency.patch",
|
||||
"sha256": "930dd88e5ecef2628973ebb4f1652f6888951d71e6531dda7d5d7a258eb435dd"
|
||||
},
|
||||
{
|
||||
"file": "xodus-metadata-recovery.patch",
|
||||
"sha256": "b72c473615f2e5d359101cb5fae404aa3b54a34a73118b1c7f99238bd16860e3"
|
||||
},
|
||||
{
|
||||
"file": "xodus-streaming-handoff.patch",
|
||||
"sha256": "3be60b5dbca7fae0cb97e18e64665662620b9527c4c1340acfb4c2e2d497e648"
|
||||
},
|
||||
{
|
||||
"file": "xodus-store-ticket.patch",
|
||||
"sha256": "5302a699a06208c9b51809eea31261a2a53facce1af3177611ecfc050abb4eb5"
|
||||
},
|
||||
{
|
||||
"file": "xodus-keyring-encoding.patch",
|
||||
"sha256": "fa6a0d4ce87f39fdb74950248f1dfd6ccecc4724c76773f5cbf84a8a003729b8"
|
||||
},
|
||||
{
|
||||
"file": "xodus-encrypted-resume.patch",
|
||||
"sha256": "73629791cbd91e93664cd77908640484298fa0a17e42a5c1b94b71b2298e8e2c"
|
||||
},
|
||||
{
|
||||
"file": "xodus-launch-image-errors.patch",
|
||||
"sha256": "180a4c094a81a6da55044fdc5be7be834575148c12e6789d11f67960d9a22ecf"
|
||||
},
|
||||
{
|
||||
"file": "xodus-keyring-unlock.patch",
|
||||
"sha256": "7762a87353d4c1a25133c8c541678cec7e233a6f67589e3d16f66b4738975baa"
|
||||
},
|
||||
{
|
||||
"file": "xodus-keyring-session-stop.patch",
|
||||
"sha256": "864e9e427f6298afa012cbbf7586b627e788bcbdc75cabf493274947dce0e8cd"
|
||||
},
|
||||
{
|
||||
"file": "xodus-keyring-persistence.patch",
|
||||
"sha256": "78782b557ec3f5457b6e697bb9262ad2403497691d8f23814b42fdd9300b7b46"
|
||||
},
|
||||
{
|
||||
"file": "xodus-keyring-create.patch",
|
||||
"sha256": "c79a46f387f7de54e3d3004d646f9e9b141c4d498eebd69a47144450b15442e6"
|
||||
},
|
||||
{
|
||||
"file": "xodus-bundle-membership.patch",
|
||||
"sha256": "a5eacc683d006b40247fbf124a62078080685b814cb09a33756083ab99adb72d"
|
||||
},
|
||||
{
|
||||
"file": "xodus-licensing-jwe.patch",
|
||||
"sha256": "6f0087e657f225e9a770405fbb34c2317f840615742c89b62f241f1b65c590ca"
|
||||
},
|
||||
{
|
||||
"file": "xodus-hosted-signin.patch",
|
||||
"sha256": "f52b16944ca7dfc837337e0257be380467f01872706252d7c2e981db0c57a8bc"
|
||||
},
|
||||
{
|
||||
"file": "xodus-durable-content.patch",
|
||||
"sha256": "3d2310fffb020396a68b99e217a81ae1b82920bfa425bf6fd8024c9ea1af6a55"
|
||||
},
|
||||
{
|
||||
"file": "xodus-conditional-entitlements.patch",
|
||||
"sha256": "8acc3e079d6f8242d364e5d6cd88bddda7004016c12ed4c48bb353499b95f347"
|
||||
},
|
||||
{
|
||||
"file": "xodus-content-device-limit.patch",
|
||||
"sha256": "d6a7115a6efd5d2acaf600590c61e38802632c7afad083639884212984fbccb7"
|
||||
},
|
||||
{
|
||||
"file": "xodus-authenticated-account-metadata.patch",
|
||||
"sha256": "1c3845c44efcb4afa49d6618b89e15f39e06804182f281a975f2df14e5a2164d"
|
||||
},
|
||||
{
|
||||
"file": "xodus-social.patch",
|
||||
"sha256": "c1571a719715df08fde865a4ec88e359dbeccf27ef3d990310692eb953d01484"
|
||||
},
|
||||
{
|
||||
"file": "xodus-social-send-receipt.patch",
|
||||
"sha256": "5b1db84e7d5754b4d2f56771c6d931ecc0579e3a00f7678b4f870fe713d60bc0"
|
||||
},
|
||||
{
|
||||
"file": "xodus-social-session.patch",
|
||||
"sha256": "96862af0bb672d6c7ed9575a21412ac68764b5c554f3aa9a380fba7b1fce235a"
|
||||
},
|
||||
{
|
||||
"file": "xodus-launch-filesystem.patch",
|
||||
"sha256": "8c898a5756149e2205ad9091203d0953506256bb84bba9080308db840d3ad030"
|
||||
},
|
||||
{
|
||||
"file": "xodus-plain-launch-entry.patch",
|
||||
"sha256": "6106f03e38d57f6d62f6662b3567dd5599a3e95b09d653d48e99eb5bba3d3fb8"
|
||||
},
|
||||
{
|
||||
"file": "xodus-package-storage.patch",
|
||||
"sha256": "76c2c805a62cc3b424bd5b91c26402a1aee46f21efbd785402aa52aea7784510"
|
||||
},
|
||||
{
|
||||
"file": "xodus-social-stdout.patch",
|
||||
"sha256": "9386eedd91d6ac48fd7c369565bb3c2f7c22688a87239ef434d3c6aeb45cf115"
|
||||
}
|
||||
],
|
||||
"nexusCommit": "396e7fb8fe0e5f00d956091195c614b8a0732ab1"
|
||||
"nexusCommit": "ba0e191e1eb8088d00eee7bfe8da80f0a8c5ec72"
|
||||
}
|
||||
@@ -1,21 +1,43 @@
|
||||
diff --git a/crates/xodus-cli/src/commands.rs b/crates/xodus-cli/src/commands.rs
|
||||
index 5a66715..5b310e4 100644
|
||||
--- a/crates/xodus-cli/src/commands.rs
|
||||
+++ b/crates/xodus-cli/src/commands.rs
|
||||
@@ -6,6 +6,7 @@ pub mod license;
|
||||
@@ -6,6 +6,7 @@
|
||||
pub mod login;
|
||||
pub mod logout;
|
||||
pub mod profile;
|
||||
+pub mod cloud_token;
|
||||
pub mod social;
|
||||
pub mod game_activity;
|
||||
pub mod achievements;
|
||||
pub mod subscription;
|
||||
diff --git a/crates/xodus-cli/src/commands/cloud_token.rs b/crates/xodus-cli/src/commands/cloud_token.rs
|
||||
new file mode 100644
|
||||
index 0000000..fbd0ed0
|
||||
--- a/crates/xodus-cli/src/main.rs
|
||||
+++ b/crates/xodus-cli/src/main.rs
|
||||
@@ -70,6 +70,8 @@
|
||||
#[arg(long, default_value_t = false)]
|
||||
json: bool,
|
||||
},
|
||||
+ #[command(about = "Get an Xbox Cloud Gaming streaming token for the stored account")]
|
||||
+ CloudToken,
|
||||
#[command(about = "Read Xbox gamertag and gamerpic for the stored account")]
|
||||
Profile {
|
||||
#[arg(long, default_value_t = false)]
|
||||
@@ -251,6 +253,7 @@
|
||||
args.command,
|
||||
SubCommand::Account { .. }
|
||||
| SubCommand::Profile { .. }
|
||||
+ | SubCommand::CloudToken
|
||||
| SubCommand::Social { .. }
|
||||
| SubCommand::GameActivity { .. }
|
||||
| SubCommand::Achievements { .. }
|
||||
@@ -317,6 +320,7 @@
|
||||
}
|
||||
},
|
||||
SubCommand::Profile { json } => commands::profile::run(&tokens, json).await,
|
||||
+ SubCommand::CloudToken => commands::cloud_token::run(&tokens).await,
|
||||
SubCommand::Social { .. } => commands::social::run(&tokens).await,
|
||||
SubCommand::GameActivity { title_id, json } => commands::game_activity::run(&tokens, title_id, json).await,
|
||||
SubCommand::Achievements { title_id, json } => commands::achievements::run(&tokens, title_id, json).await,
|
||||
--- /dev/null
|
||||
+++ b/crates/xodus-cli/src/commands/cloud_token.rs
|
||||
@@ -0,0 +1,124 @@
|
||||
@@ -0,0 +1,237 @@
|
||||
+//! Xbox Cloud Gaming streaming token for the stored account (DroidDeck). Same bearer
|
||||
+//! RPS -> Xbox user -> XSTS exchange as the profile read, for the cloud gaming relying party,
|
||||
+//! then the streaming service's user login (as xbox.com and Greenlight's xal-node do).
|
||||
@@ -41,7 +63,7 @@ index 0000000..fbd0ed0
|
||||
+ ExchangeUserTokenOutcome::Issued(soap::BodyContent::RequestSecurityTokenResponse(response)) => *response,
|
||||
+ _ => return Err("msa-response"),
|
||||
+ };
|
||||
+ // Token::from panics on token types it does not know; only take the compact forms here. The cloud
|
||||
+ // Only accept compact forms here and reject incomplete token responses. The cloud
|
||||
+ // transfer purpose answers with a login proof token, which is what /connect takes (Greenlight
|
||||
+ // sends the MSAL response's "lpt").
|
||||
+ let kind = response.token_type.clone();
|
||||
@@ -64,7 +86,7 @@ index 0000000..fbd0ed0
|
||||
+ eprintln!("NEXUS_SESSION_DIAGNOSTIC_V1 ticket-type-{slug}");
|
||||
+ return Err("msa-ticket");
|
||||
+ }
|
||||
+ let Token::Compact(ticket) = Token::from(response) else { return Err("msa-ticket"); };
|
||||
+ let Token::Compact(ticket) = Token::try_from(response).map_err(|_| "msa-ticket")? else { return Err("msa-ticket"); };
|
||||
+ Ok((account, ticket))
|
||||
+}
|
||||
+
|
||||
@@ -92,30 +114,53 @@ index 0000000..fbd0ed0
|
||||
+ }).take(32).collect()).unwrap_or_default()
|
||||
+}
|
||||
+
|
||||
+fn offering_response(body: &[u8]) -> Result<Value, &'static str> {
|
||||
+ let value: Value = serde_json::from_slice(body).map_err(|_| "gssv-json")?;
|
||||
+ value["gsToken"].as_str().filter(|token| !token.is_empty() && token.len() <= 16384).ok_or("gs-token")?;
|
||||
+ Ok(value)
|
||||
+}
|
||||
+
|
||||
+async fn request_offering(client: &reqwest::Client, endpoint: &str, xsts: &str, offering: &str) -> Result<Value, &'static str> {
|
||||
+ let response = client.post(endpoint)
|
||||
+ .header("x-gssv-client", "XboxComBrowser").header("Cache-Control", "no-store, must-revalidate, no-cache")
|
||||
+ .json(&json!({ "token": xsts, "offeringId": offering })).send().await.map_err(|_| "gssv-request")?;
|
||||
+ let body = super::profile::bounded(response, 256 * 1024).await.map_err(|_| "gssv-response")?;
|
||||
+ offering_response(&body)
|
||||
+}
|
||||
+
|
||||
+async fn select_offering<F, Fut>(mut request: F) -> Result<(&'static str, Value), String>
|
||||
+where
|
||||
+ F: FnMut(&'static str) -> Fut,
|
||||
+ Fut: std::future::Future<Output = Result<Value, &'static str>>,
|
||||
+{
|
||||
+ let mut failures = Vec::new();
|
||||
+ for offering in OFFERINGS {
|
||||
+ match request(offering).await {
|
||||
+ Ok(value) => return Ok((offering, value)),
|
||||
+ Err(stage) => failures.push(format!("{offering}:{stage}")),
|
||||
+ }
|
||||
+ }
|
||||
+ Err(format!("gssv-login {}", failures.join(" ")))
|
||||
+}
|
||||
+
|
||||
+async fn login(tokens: &TokenManager) -> Result<Value, String> {
|
||||
+ let client = reqwest::Client::builder().redirect(reqwest::redirect::Policy::none())
|
||||
+ .timeout(super::session::REQUEST_TIMEOUT).user_agent("xodus-nexus-cloud/1").build().map_err(|_| "http-client")?;
|
||||
+ let (account, xsts) = xsts(tokens, &client).await?;
|
||||
+ let mut failures = Vec::new();
|
||||
+ for offering in OFFERINGS {
|
||||
+ let response = client.post(format!("https://{offering}.gssv-play-prod.xboxlive.com/v2/login/user"))
|
||||
+ .header("x-gssv-client", "XboxComBrowser").header("Cache-Control", "no-store, must-revalidate, no-cache")
|
||||
+ .json(&json!({ "token": xsts, "offeringId": offering })).send().await.map_err(|_| "gssv-request")?;
|
||||
+ let status = response.status().as_u16();
|
||||
+ let body = super::profile::bounded(response, 256 * 1024).await;
|
||||
+ let Ok(body) = body else { failures.push(format!("{offering}:{status}")); continue; };
|
||||
+ let value: Value = serde_json::from_slice(&body).map_err(|_| "gssv-json")?;
|
||||
+ let token = value["gsToken"].as_str().filter(|token| !token.is_empty() && token.len() <= 16384).ok_or("gs-token")?;
|
||||
+ // Diagnostic lines are letters and dashes only (the app's allow-list).
|
||||
+ eprintln!("NEXUS_SESSION_DIAGNOSTIC_V1 gssv-login-ok-{}", if offering == "xgpuweb" { "gamepass" } else { "free" });
|
||||
+ let transfer = transfer_token(tokens, &client).await;
|
||||
+ eprintln!("NEXUS_SESSION_DIAGNOSTIC_V1 transfer-token-{}", if transfer.is_ok() { "ok" } else { "missing" });
|
||||
+ if tokens.get_user().map_err(|_| "account-changed")?.username != account { return Err("account-changed".into()); }
|
||||
+ return Ok(json!({ "schema": 1, "account": account, "offering": offering, "gsToken": token, "userToken": transfer.ok(),
|
||||
+ "durationInSeconds": value["durationInSeconds"].as_u64().unwrap_or(0), "market": value["market"].as_str().unwrap_or_default(),
|
||||
+ "regions": regions(&value) }));
|
||||
+ }
|
||||
+ Err(format!("gssv-login {}", failures.join(" ")))
|
||||
+ let (offering, value) = select_offering(|offering| {
|
||||
+ let endpoint = format!("https://{offering}.gssv-play-prod.xboxlive.com/v2/login/user");
|
||||
+ let client = &client;
|
||||
+ let xsts = &xsts;
|
||||
+ async move { request_offering(client, &endpoint, xsts, offering).await }
|
||||
+ }).await?;
|
||||
+ // Diagnostic lines are letters and dashes only (the app's allow-list).
|
||||
+ eprintln!("NEXUS_SESSION_DIAGNOSTIC_V1 gssv-login-ok-{}", if offering == "xgpuweb" { "gamepass" } else { "free" });
|
||||
+ let transfer = transfer_token(tokens, &client).await;
|
||||
+ eprintln!("NEXUS_SESSION_DIAGNOSTIC_V1 transfer-token-{}", if transfer.is_ok() { "ok" } else { "missing" });
|
||||
+ if tokens.get_user().map_err(|_| "account-changed")?.username != account { return Err("account-changed".into()); }
|
||||
+ Ok(json!({ "schema": 1, "account": account, "offering": offering, "gsToken": value["gsToken"], "userToken": transfer.ok(),
|
||||
+ "durationInSeconds": value["durationInSeconds"].as_u64().unwrap_or(0), "market": value["market"].as_str().unwrap_or_default(),
|
||||
+ "regions": regions(&value) }))
|
||||
+}
|
||||
+
|
||||
+pub async fn run(tokens: &TokenManager) -> ExitCode {
|
||||
@@ -139,33 +184,94 @@ index 0000000..fbd0ed0
|
||||
+ assert_eq!(list.len(), 1);
|
||||
+ assert_eq!(list[0]["baseUri"], "https://weu.core.gssv-play-prod.xboxlive.com");
|
||||
+ }
|
||||
+ #[tokio::test]
|
||||
+ async fn cloud_fallback_first_success_does_not_call_second_offering() {
|
||||
+ let mut calls = Vec::new();
|
||||
+ let (offering, value) = select_offering(|name| {
|
||||
+ calls.push(name);
|
||||
+ std::future::ready(Ok(json!({"gsToken":"synthetic"})))
|
||||
+ }).await.unwrap();
|
||||
+ assert_eq!(calls, vec!["xgpuweb"]);
|
||||
+ assert_eq!(offering, "xgpuweb");
|
||||
+ assert_eq!(value["gsToken"], "synthetic");
|
||||
+ }
|
||||
+
|
||||
+ #[tokio::test]
|
||||
+ async fn cloud_fallback_request_failure_tries_second_offering() {
|
||||
+ let mut calls = Vec::new();
|
||||
+ let (offering, _) = select_offering(|name| {
|
||||
+ calls.push(name);
|
||||
+ std::future::ready(if name == "xgpuweb" { Err("gssv-request") }
|
||||
+ else { Ok(json!({"gsToken":"synthetic"})) })
|
||||
+ }).await.unwrap();
|
||||
+ assert_eq!(calls, OFFERINGS);
|
||||
+ assert_eq!(offering, "xgpuwebf2p");
|
||||
+ }
|
||||
+
|
||||
+ #[tokio::test]
|
||||
+ async fn cloud_fallback_invalid_json_or_token_tries_second_offering() {
|
||||
+ let invalid = vec![b"not-json".to_vec(), b"{}".to_vec(),
|
||||
+ br#"{"gsToken":""}"#.to_vec(), br#"{"gsToken":17}"#.to_vec(),
|
||||
+ serde_json::to_vec(&json!({"gsToken":"x".repeat(16385)})).unwrap()];
|
||||
+ for body in invalid {
|
||||
+ let mut calls = Vec::new();
|
||||
+ let (offering, _) = select_offering(|name| {
|
||||
+ calls.push(name);
|
||||
+ std::future::ready(if name == "xgpuweb" { offering_response(&body) }
|
||||
+ else { offering_response(br#"{"gsToken":"synthetic"}"#) })
|
||||
+ }).await.unwrap();
|
||||
+ assert_eq!(calls, OFFERINGS);
|
||||
+ assert_eq!(offering, "xgpuwebf2p");
|
||||
+ }
|
||||
+ assert!(offering_response(&serde_json::to_vec(&json!({"gsToken":"x".repeat(16384)})).unwrap()).is_ok());
|
||||
+ }
|
||||
+
|
||||
+ #[tokio::test]
|
||||
+ async fn cloud_fallback_all_failures_report_only_fixed_stages() {
|
||||
+ let mut calls = Vec::new();
|
||||
+ let error = select_offering(|name| {
|
||||
+ calls.push(name);
|
||||
+ std::future::ready(offering_response(b"private response containing a token or URL"))
|
||||
+ }).await.unwrap_err();
|
||||
+ assert_eq!(calls, OFFERINGS);
|
||||
+ assert_eq!(error, "gssv-login xgpuweb:gssv-json xgpuwebf2p:gssv-json");
|
||||
+ }
|
||||
+
|
||||
+ async fn http_fixture(status: u16, body: Vec<u8>) -> (String, tokio::task::JoinHandle<()>) {
|
||||
+ use tokio::{io::{AsyncReadExt, AsyncWriteExt}, net::TcpListener};
|
||||
+ let server = TcpListener::bind("127.0.0.1:0").await.unwrap();
|
||||
+ let address = server.local_addr().unwrap();
|
||||
+ let task = tokio::spawn(async move {
|
||||
+ let (mut socket, _) = server.accept().await.unwrap();
|
||||
+ let mut request = Vec::new();
|
||||
+ let mut buffer = [0u8; 4096];
|
||||
+ loop {
|
||||
+ let n = socket.read(&mut buffer).await.unwrap();
|
||||
+ assert!(n > 0 && request.len() + n < 16384);
|
||||
+ request.extend_from_slice(&buffer[..n]);
|
||||
+ if let Some(end) = request.windows(4).position(|part| part == b"\r\n\r\n") {
|
||||
+ let headers = String::from_utf8_lossy(&request[..end]).to_ascii_lowercase();
|
||||
+ let length: usize = headers.lines().find_map(|line| line.strip_prefix("content-length:").map(str::trim)).unwrap_or("0").parse().unwrap();
|
||||
+ if request.len() >= end + 4 + length { break; }
|
||||
+ }
|
||||
+ }
|
||||
+ let header = format!("HTTP/1.1 {status} Fixture\r\nContent-Length: {}\r\nConnection: close\r\n\r\n", body.len());
|
||||
+ if socket.write_all(header.as_bytes()).await.is_ok() { let _ = socket.write_all(&body).await; }
|
||||
+ });
|
||||
+ (format!("http://{address}/login"), task)
|
||||
+ }
|
||||
+
|
||||
+ #[tokio::test]
|
||||
+ async fn cloud_fallback_http_refusal_or_oversized_body_reaches_second_offering() {
|
||||
+ let client = reqwest::Client::builder().no_proxy().timeout(Duration::from_secs(15)).build().unwrap();
|
||||
+ for (status, body) in [(403, b"<html>Forbidden</html>".to_vec()), (200, vec![b'x'; 256 * 1024 + 1])] {
|
||||
+ let (first, first_task) = http_fixture(status, body).await;
|
||||
+ let (second, second_task) = http_fixture(200, br#"{"gsToken":"synthetic"}"#.to_vec()).await;
|
||||
+ let (offering, _) = select_offering(|name| request_offering(&client,
|
||||
+ if name == "xgpuweb" { &first } else { &second }, "synthetic-xsts", name)).await.unwrap();
|
||||
+ assert_eq!(offering, "xgpuwebf2p");
|
||||
+ first_task.await.unwrap(); second_task.await.unwrap();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/crates/xodus-cli/src/main.rs b/crates/xodus-cli/src/main.rs
|
||||
index 1ae4167..4b0ac26 100644
|
||||
--- a/crates/xodus-cli/src/main.rs
|
||||
+++ b/crates/xodus-cli/src/main.rs
|
||||
@@ -68,6 +68,8 @@ enum SubCommand {
|
||||
#[arg(long, default_value_t = false)]
|
||||
json: bool,
|
||||
},
|
||||
+ #[command(about = "Get an Xbox Cloud Gaming streaming token for the stored account")]
|
||||
+ CloudToken,
|
||||
#[command(about = "Read Xbox gamertag and gamerpic for the stored account")]
|
||||
Profile {
|
||||
#[arg(long, default_value_t = false)]
|
||||
@@ -239,6 +241,7 @@ async fn main() -> ExitCode {
|
||||
args.command,
|
||||
SubCommand::Account { .. }
|
||||
| SubCommand::Profile { .. }
|
||||
+ | SubCommand::CloudToken
|
||||
| SubCommand::GameActivity { .. }
|
||||
| SubCommand::Achievements { .. }
|
||||
| SubCommand::Library { .. }
|
||||
@@ -304,6 +307,7 @@ async fn main() -> ExitCode {
|
||||
}
|
||||
},
|
||||
SubCommand::Profile { json } => commands::profile::run(&tokens, json).await,
|
||||
+ SubCommand::CloudToken => commands::cloud_token::run(&tokens).await,
|
||||
SubCommand::GameActivity { title_id, json } => commands::game_activity::run(&tokens, title_id, json).await,
|
||||
SubCommand::Achievements { title_id, json } => commands::achievements::run(&tokens, title_id, json).await,
|
||||
SubCommand::Login => commands::login::run(&client, &tokens).await,
|
||||
@@ -85,8 +85,44 @@
|
||||
+pub fn destroy_secrets() {}
|
||||
--- a/crates/xodus/src/tokens/backend/keychain.rs
|
||||
+++ b/crates/xodus/src/tokens/backend/keychain.rs
|
||||
@@ -1,22 +1,43 @@
|
||||
@@ -1,131 +1,43 @@
|
||||
-use base64::{Engine as _, engine::general_purpose::STANDARD};
|
||||
-
|
||||
use crate::tokens::store::{TokenBackend, TokenStoreError};
|
||||
-
|
||||
-// GNOME Keyring's passwordless textual format writes secrets with
|
||||
-// g_key_file_set_value but reads them with g_key_file_get_string. Backslash
|
||||
-// escapes in JSON (notably XML token attributes) can therefore be rejected or
|
||||
-// changed on reload. ASCII base64 avoids those escapes without changing the
|
||||
-// selected keyring or its security policy. This is encoding, not encryption.
|
||||
-const ENVELOPE: &[u8] = b"XODUS_KEYRING_BASE64_V1:";
|
||||
-
|
||||
-fn encode_secret(value: &[u8]) -> Vec<u8> {
|
||||
- let mut encoded = ENVELOPE.to_vec();
|
||||
- encoded.extend_from_slice(STANDARD.encode(value).as_bytes());
|
||||
- encoded
|
||||
-}
|
||||
-
|
||||
-fn decode_secret(bytes: Vec<u8>) -> Result<Vec<u8>, TokenStoreError> {
|
||||
- match bytes.strip_prefix(ENVELOPE) {
|
||||
- Some(encoded) => STANDARD.decode(encoded).map_err(|_| {
|
||||
- std::io::Error::new(
|
||||
- std::io::ErrorKind::InvalidData,
|
||||
- "Invalid encoded Xodus credential",
|
||||
- )
|
||||
- .into()
|
||||
- }),
|
||||
- // Existing credentials are raw JSON. Do not rewrite or delete on reads.
|
||||
- None => Ok(bytes),
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-fn deletion_result(result: Result<(), keyring_core::Error>) -> Result<(), TokenStoreError> {
|
||||
- match result {
|
||||
- Ok(()) | Err(keyring_core::Error::NoEntry) => Ok(()),
|
||||
- Err(error) => Err(error.into()),
|
||||
- }
|
||||
-}
|
||||
+use serde_json::{Value, json};
|
||||
+use std::io::{BufRead, Read, Write};
|
||||
+use std::os::linux::net::SocketAddrExt;
|
||||
@@ -118,7 +154,7 @@
|
||||
fn get(&self, key: &str) -> Result<Option<Vec<u8>>, TokenStoreError> {
|
||||
- let entry = crate::secrets::get_entry(key)?;
|
||||
- match entry.get_secret() {
|
||||
- Ok(bytes) => Ok(Some(bytes)),
|
||||
- Ok(bytes) => Ok(Some(decode_secret(bytes)?)),
|
||||
- Err(keyring_core::Error::NoEntry) => Ok(None),
|
||||
- Err(e) => Err(e.into()),
|
||||
- }
|
||||
@@ -128,27 +164,185 @@
|
||||
}
|
||||
-
|
||||
fn set(&self, key: &str, value: &[u8]) -> Result<(), TokenStoreError> {
|
||||
- Ok(crate::secrets::get_entry(key)?.set_secret(value)?)
|
||||
- crate::secrets::get_entry(key)?.set_secret(&encode_secret(value))?;
|
||||
- #[cfg(all(target_os = "linux", not(feature = "key-chain-file")))]
|
||||
- crate::keyring_persistence::sync_after_write();
|
||||
+ request(json!({"op":"set", "key":key, "value":value}))?;
|
||||
+ Ok(())
|
||||
Ok(())
|
||||
}
|
||||
-
|
||||
fn remove(&self, key: &str) -> Result<(), TokenStoreError> {
|
||||
- Ok(crate::secrets::get_entry(key)?.delete_credential()?)
|
||||
- deletion_result(crate::secrets::get_entry(key)?.delete_credential())?;
|
||||
- #[cfg(all(target_os = "linux", not(feature = "key-chain-file")))]
|
||||
- crate::keyring_persistence::sync_after_write();
|
||||
+ request(json!({"op":"remove", "key":key}))?;
|
||||
+ Ok(())
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
-
|
||||
-#[cfg(test)]
|
||||
-mod tests {
|
||||
- use super::*;
|
||||
-
|
||||
- #[test]
|
||||
- fn credential_encoding_preserves_xml_json_and_binary() {
|
||||
- let xml_json = br#"{"token":"<EncryptedData Id=\"synthetic\">dummy</EncryptedData>","escapes":"a\\b\n\t\r"}"#;
|
||||
- let binary: Vec<u8> = (0..=255).collect();
|
||||
- for value in [
|
||||
- xml_json.as_slice(),
|
||||
- b"".as_slice(),
|
||||
- binary.as_slice(),
|
||||
- "synthetic-\u{00e9}".as_bytes(),
|
||||
- ] {
|
||||
- let encoded = encode_secret(value);
|
||||
- assert!(encoded.starts_with(ENVELOPE));
|
||||
- // No GKeyFile escapes or physical line breaks can be introduced.
|
||||
- assert!(encoded.is_ascii());
|
||||
- assert!(
|
||||
- !encoded
|
||||
- .iter()
|
||||
- .any(|byte| matches!(byte, b'\\' | b'\n' | b'\r' | 0))
|
||||
- );
|
||||
- assert_eq!(decode_secret(encoded).unwrap(), value);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- #[test]
|
||||
- fn credential_encoding_accepts_legacy_values_without_rewriting() {
|
||||
- for value in [
|
||||
- br#"{"username":"synthetic"}"#.as_slice(),
|
||||
- b"".as_slice(),
|
||||
- b"invalid legacy JSON".as_slice(),
|
||||
- ] {
|
||||
- // Validation of legacy JSON remains the TokenManager's job.
|
||||
- assert_eq!(decode_secret(value.to_vec()).unwrap(), value);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- #[test]
|
||||
- fn credential_encoding_rejects_malformed_envelopes_without_leaking_values() {
|
||||
- for bad in [
|
||||
- b"%%%synthetic-secret-never-print".as_slice(),
|
||||
- b"YQ".as_slice(),
|
||||
- ] {
|
||||
- let mut encoded = ENVELOPE.to_vec();
|
||||
- encoded.extend_from_slice(bad);
|
||||
- let error = decode_secret(encoded).unwrap_err();
|
||||
- assert!(matches!(error, TokenStoreError::Io(_)));
|
||||
- assert!(!error.to_string().contains("synthetic-secret-never-print"));
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- #[test]
|
||||
- fn credential_deletion_is_idempotent_but_keeps_other_errors() {
|
||||
- assert!(deletion_result(Ok(())).is_ok());
|
||||
- assert!(deletion_result(Err(keyring_core::Error::NoEntry)).is_ok());
|
||||
- assert!(matches!(
|
||||
- deletion_result(Err(keyring_core::Error::Invalid(
|
||||
- "synthetic".into(),
|
||||
- "failure".into()
|
||||
- ))),
|
||||
- Err(TokenStoreError::Keychain(_))
|
||||
- ));
|
||||
- }
|
||||
-}
|
||||
--- a/crates/xodus/Cargo.toml
|
||||
+++ b/crates/xodus/Cargo.toml
|
||||
@@ -43,8 +43,8 @@
|
||||
@@ -43,9 +43,9 @@
|
||||
smbios-lib = "0.9.4"
|
||||
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
-dbus = "=0.9.12"
|
||||
-x11-dl = "=2.21.0"
|
||||
-dbus-secret-service-keyring-store = { version = "1.0.1", features = ["crypto-openssl"]}
|
||||
+dbus = { version = "=0.9.12", optional = true }
|
||||
+x11-dl = { version = "=2.21.0", optional = true }
|
||||
+dbus-secret-service-keyring-store = { version = "1.0.1", features = ["crypto-openssl"], optional = true}
|
||||
|
||||
[target.'cfg(target_os = "macos")'.dependencies]
|
||||
apple-native-keyring-store = { version = "1.0.2", features = ["keychain"]}
|
||||
--- a/crates/xodus/src/lib.rs
|
||||
+++ b/crates/xodus/src/lib.rs
|
||||
@@ -2,12 +2,6 @@
|
||||
pub mod auth;
|
||||
pub mod clep;
|
||||
pub mod hardware;
|
||||
-#[cfg(target_os = "linux")]
|
||||
-mod keyring_persistence;
|
||||
-#[cfg(target_os = "linux")]
|
||||
-pub mod keyring_session;
|
||||
-#[cfg(target_os = "linux")]
|
||||
-pub mod keyring_unlock;
|
||||
pub mod licensing;
|
||||
pub mod models;
|
||||
pub mod secrets;
|
||||
--- a/crates/xodus-cli/src/main.rs
|
||||
+++ b/crates/xodus-cli/src/main.rs
|
||||
@@ -18,24 +18,6 @@
|
||||
|
||||
#[derive(Subcommand)]
|
||||
enum SubCommand {
|
||||
- #[cfg(target_os = "linux")]
|
||||
- #[command(about = "Gracefully stop only a Nexus-owned session keyring without accessing credentials")]
|
||||
- KeyringSessionStop {
|
||||
- #[arg(long)]
|
||||
- provider_pid: u32,
|
||||
- },
|
||||
- #[cfg(target_os = "linux")]
|
||||
- #[command(about = "Create the first default wallet using the provider's password dialog")]
|
||||
- KeyringCreate {
|
||||
- #[arg(long, default_value = "")]
|
||||
- window_id: String,
|
||||
- },
|
||||
- #[cfg(target_os = "linux")]
|
||||
- #[command(about = "Unlock the default system wallet without reading credentials or signing in")]
|
||||
- KeyringUnlock {
|
||||
- #[arg(long, default_value = "")]
|
||||
- window_id: String,
|
||||
- },
|
||||
#[command(about = "Resolve public Store packages without sign-in or downloading")]
|
||||
ResolvePackage {
|
||||
product: String,
|
||||
@@ -238,29 +220,6 @@
|
||||
.build()
|
||||
.unwrap();
|
||||
let args = CliArgs::parse();
|
||||
- #[cfg(target_os = "linux")]
|
||||
- if let SubCommand::KeyringSessionStop { provider_pid } = &args.command {
|
||||
- let state = xodus::keyring_session::stop_session_provider(*provider_pid);
|
||||
- println!("{}", serde_json::json!({"schema": 1, "state": state.as_str()}));
|
||||
- return if state == xodus::keyring_session::StopState::Unavailable { ExitCode::FAILURE } else { ExitCode::SUCCESS };
|
||||
- }
|
||||
- #[cfg(target_os = "linux")]
|
||||
- if let SubCommand::KeyringUnlock { window_id } | SubCommand::KeyringCreate { window_id } = &args.command {
|
||||
- use std::sync::{Arc, atomic::{AtomicBool, Ordering}};
|
||||
- let cancelled = Arc::new(AtomicBool::new(false));
|
||||
- let signal = cancelled.clone();
|
||||
- let state = if ctrlc::set_handler(move || { signal.store(true, Ordering::SeqCst); }).is_err() {
|
||||
- xodus::keyring_unlock::UnlockState::Unavailable
|
||||
- } else {
|
||||
- if matches!(&args.command, SubCommand::KeyringCreate { .. }) {
|
||||
- xodus::keyring_unlock::create_default(window_id, &cancelled)
|
||||
- } else {
|
||||
- xodus::keyring_unlock::unlock_default(window_id, &cancelled)
|
||||
- }
|
||||
- };
|
||||
- println!("{}", serde_json::json!({"schema": 1, "state": state.as_str()}));
|
||||
- return ExitCode::SUCCESS;
|
||||
- }
|
||||
#[cfg(not(feature = "native-webview"))]
|
||||
if args.external_webview_stdio {
|
||||
webview::enable_stdio();
|
||||
@@ -308,12 +267,6 @@
|
||||
}
|
||||
|
||||
let code = match args.command {
|
||||
- #[cfg(target_os = "linux")]
|
||||
- SubCommand::KeyringSessionStop { .. } => unreachable!(),
|
||||
- #[cfg(target_os = "linux")]
|
||||
- SubCommand::KeyringUnlock { .. } => unreachable!(),
|
||||
- #[cfg(target_os = "linux")]
|
||||
- SubCommand::KeyringCreate { .. } => unreachable!(),
|
||||
SubCommand::ResolvePackage { .. } => unreachable!(),
|
||||
SubCommand::Download {
|
||||
product,
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/crates/xodus-cli/src/commands/run.rs
|
||||
+++ b/crates/xodus-cli/src/commands/run.rs
|
||||
@@ -77,6 +77,7 @@
|
||||
@@ -146,6 +146,7 @@
|
||||
launch_image: &Path,
|
||||
materialize_chain: bool,
|
||||
) -> (String, String) {
|
||||
@@ -8,7 +8,7 @@
|
||||
let source_nt = source.to_string_lossy().replace('/', "\\");
|
||||
let source_nt = source_nt.trim_end_matches('\\');
|
||||
let mirror_unix = mirror_nt_prefix.map(|prefix| prefix.replace('\\', "/"));
|
||||
@@ -200,9 +201,7 @@
|
||||
@@ -303,9 +304,7 @@
|
||||
let entry_path = checked_relative_path(entry_suffix)?;
|
||||
let mut decrypted = HashMap::new();
|
||||
for (name, fd) in fds {
|
||||
@@ -19,22 +19,41 @@
|
||||
}
|
||||
if !decrypted.contains_key(&entry_path) {
|
||||
return Err(std::io::Error::new(
|
||||
@@ -222,11 +221,8 @@
|
||||
@@ -325,7 +324,8 @@
|
||||
}
|
||||
}
|
||||
let decrypted_files: HashSet<PathBuf> = decrypted.keys().cloned().collect();
|
||||
- let parent = source_root.parent().unwrap_or_else(|| Path::new("/tmp"));
|
||||
- let mirror = Builder::new()
|
||||
- .prefix(".xodus-chain-")
|
||||
- .tempdir_in(parent)
|
||||
- .or_else(|_| Builder::new().prefix("xodus-chain-").tempdir())?;
|
||||
- let mirror = launch_view_directory(source_root, ".xodus-chain-")?;
|
||||
+ let mirror = Builder::new().prefix("droiddeck-xbox-")
|
||||
+ .permissions(std::os::unix::fs::PermissionsExt::from_mode(0o700)).tempdir()?;
|
||||
populate_launch_view(
|
||||
source_root,
|
||||
mirror.path(),
|
||||
@@ -667,21 +663,15 @@
|
||||
use std::os::fd::AsRawFd;
|
||||
@@ -725,6 +725,22 @@
|
||||
);
|
||||
}
|
||||
|
||||
+ if wine == "droiddeck:prepare" {
|
||||
+ use std::io::Write;
|
||||
+ if !materialize_chain { return ExitCode::FAILURE; }
|
||||
+ let ready = serde_json::json!({
|
||||
+ "exe": stub_path,
|
||||
+ "playfab": playfab_auth_header(client, tokens).await,
|
||||
+ });
|
||||
+ println!("DROIDDECK_LAUNCH_V1 {}", ready);
|
||||
+ let _ = std::io::stdout().flush();
|
||||
+ let mut release = String::new();
|
||||
+ let _ = std::io::stdin().read_line(&mut release);
|
||||
+ drop(launch_mirror);
|
||||
+ cleanup().await;
|
||||
+ return ExitCode::SUCCESS;
|
||||
+ }
|
||||
+
|
||||
let mut command = Command::new(wine);
|
||||
command
|
||||
.arg(&stub_path)
|
||||
@@ -831,21 +847,15 @@
|
||||
}
|
||||
|
||||
#[test]
|
||||
- fn full_launch_view_uses_real_executables_and_preserves_encrypted_dll_maps() {
|
||||
@@ -58,13 +77,10 @@
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -778,6 +768,25 @@
|
||||
.is_symlink());
|
||||
assert_eq!(std::fs::read(source.join("Dungeons.exe")).unwrap(), b"encrypted launcher");
|
||||
assert_eq!(std::fs::read(nested.join("Shipping.exe")).unwrap(), b"encrypted child");
|
||||
+ }
|
||||
+
|
||||
+ #[test]
|
||||
@@ -945,6 +955,44 @@
|
||||
}
|
||||
|
||||
#[test]
|
||||
+ fn launch_view_materializes_encrypted_dlls_in_private_storage() {
|
||||
+ let root = tempfile::tempdir().unwrap();
|
||||
+ std::fs::write(root.path().join("Game.exe"), b"encrypted").unwrap();
|
||||
@@ -81,26 +97,54 @@
|
||||
+ assert_eq!(std::fs::read(root.path().join("Secret.dll")).unwrap(), b"encrypted-dll");
|
||||
+ use std::os::unix::fs::PermissionsExt;
|
||||
+ assert_eq!(std::fs::metadata(view.path()).unwrap().permissions().mode() & 0o077, 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
--- a/crates/xodus-cli/src/commands/run.rs
|
||||
+++ b/crates/xodus-cli/src/commands/run.rs
|
||||
@@ -618 +618,17 @@
|
||||
+ if wine == "droiddeck:prepare" {
|
||||
+ use std::io::Write;
|
||||
+ if !materialize_chain { return ExitCode::FAILURE; }
|
||||
+ let ready = serde_json::json!({
|
||||
+ "exe": stub_path,
|
||||
+ "playfab": playfab_auth_header(client, tokens).await,
|
||||
+ });
|
||||
+ println!("DROIDDECK_LAUNCH_V1 {}", ready);
|
||||
+ let _ = std::io::stdout().flush();
|
||||
+ let mut release = String::new();
|
||||
+ let _ = std::io::stdin().read_line(&mut release);
|
||||
+ drop(launch_mirror);
|
||||
+ cleanup().await;
|
||||
+ return ExitCode::SUCCESS;
|
||||
+ }
|
||||
+
|
||||
let mut command = Command::new(wine);
|
||||
+
|
||||
+ #[test]
|
||||
+ fn launch_view_rejects_invalid_decrypted_library_without_changing_sources() {
|
||||
+ let root = tempfile::tempdir().unwrap();
|
||||
+ std::fs::write(root.path().join("Game.exe"), b"encrypted executable").unwrap();
|
||||
+ std::fs::write(root.path().join("Bad.dll"), b"encrypted library").unwrap();
|
||||
+ let mut exe_image = tempfile::tempfile().unwrap();
|
||||
+ exe_image.write_all(&fake_pe()).unwrap();
|
||||
+ let mut dll_image = tempfile::tempfile().unwrap();
|
||||
+ dll_image.write_all(b"not a PE library").unwrap();
|
||||
+ let exe = String::from("Game.exe");
|
||||
+ let dll = String::from("Bad.dll");
|
||||
+ let images = [(&exe, exe_image.as_raw_fd()), (&dll, dll_image.as_raw_fd())];
|
||||
+ let error = create_launch_chain_mirror(root.path(), &exe, &images).unwrap_err();
|
||||
+ assert_eq!(error.kind(), std::io::ErrorKind::InvalidData);
|
||||
+ assert_eq!(std::fs::read(root.path().join("Game.exe")).unwrap(), b"encrypted executable");
|
||||
+ assert_eq!(std::fs::read(root.path().join("Bad.dll")).unwrap(), b"encrypted library");
|
||||
+ }
|
||||
+
|
||||
+ #[test]
|
||||
fn launch_chain_rejects_parent_path_components() {
|
||||
assert!(checked_relative_path("..\\outside.exe").is_err());
|
||||
}
|
||||
@@ -961,16 +1009,20 @@
|
||||
assert_eq!(name, "Bin\\MINECRAFT.WINDOWS.EXE");
|
||||
assert!(!fcntl_getfd(file.as_fd()).unwrap().contains(FdFlags::CLOEXEC));
|
||||
let dll_name = String::from("Encrypted.dll");
|
||||
- let mut dll = tempfile::tempfile().unwrap(); dll.write_all(b"synthetic decrypted library").unwrap();
|
||||
+ std::fs::write(root.path().join("Encrypted.dll"), b"encrypted library").unwrap();
|
||||
+ let mut dll = tempfile::tempfile().unwrap(); dll.write_all(&fake_pe()).unwrap();
|
||||
let images = [(&dll_name, dll.as_raw_fd()), (&name, file.as_raw_fd())];
|
||||
assert!(select_launch_entry(&images[..1], Some("bin/Minecraft.Windows.exe")).is_err());
|
||||
assert_eq!(select_launch_entry(&images, Some("bin/Minecraft.Windows.exe")).unwrap().1, file.as_raw_fd());
|
||||
let (mirror, entry, count, bytes) = create_launch_chain_mirror(root.path(), &name, &images).unwrap();
|
||||
- assert_eq!(count, 1); assert_eq!(bytes, original.len() as u64);
|
||||
+ assert_eq!(count, 2); assert_eq!(bytes, 2 * original.len() as u64);
|
||||
assert_eq!(std::fs::read(entry).unwrap(), original);
|
||||
- let (nt, _) = launch_file_maps(&images, root.path(), Some("\\synthetic-view"), &name, file.as_raw_fd(), &mirror.path().join("Bin/MINECRAFT.WINDOWS.EXE"), true);
|
||||
- assert!(nt.contains("synthetic-view\\Encrypted.dll"));
|
||||
- assert!(!nt.contains("synthetic-view\\Bin\\MINECRAFT.WINDOWS.EXE"));
|
||||
+ let (nt, unix) = launch_file_maps(&images, root.path(), Some("\\synthetic-view"), &name, file.as_raw_fd(), &mirror.path().join("Bin/MINECRAFT.WINDOWS.EXE"), true);
|
||||
+ assert!(nt.is_empty());
|
||||
+ assert!(unix.is_empty());
|
||||
+ assert_eq!(std::fs::read(mirror.path().join("Encrypted.dll")).unwrap(), fake_pe());
|
||||
+ assert!(!std::fs::symlink_metadata(mirror.path().join("Encrypted.dll")).unwrap().file_type().is_symlink());
|
||||
+ assert_eq!(std::fs::read(root.path().join("Encrypted.dll")).unwrap(), b"encrypted library");
|
||||
assert_eq!(std::fs::read(root.path().join("Bin/MINECRAFT.WINDOWS.EXE")).unwrap(), original);
|
||||
assert_eq!(std::fs::read(root.path().join("MicrosoftGame.config")).unwrap(), b"metadata unchanged");
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
--- a/crates/xodus/src/models/secrets.rs
|
||||
+++ b/crates/xodus/src/models/secrets.rs
|
||||
@@ -80,9 +80,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
-/// Store and licensing services reject delegation-compact tickets in the "d="
|
||||
-/// form that Xbox Live sign-in needs (InvalidMsaTicketFormat) and accept the
|
||||
-/// same value as "t=". Convert only where a ticket is sent to those services.
|
||||
+// Xbox accepts compact JWE tickets without the delegation prefix; opaque
|
||||
+// delegation tickets keep their original wire representation.
|
||||
+pub fn xbox_ticket(ticket: String) -> String {
|
||||
+ match ticket.strip_prefix("d=") {
|
||||
+ Some(raw) if is_compact_jwe(raw) => raw.to_owned(),
|
||||
+ _ => ticket,
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/// Store services accept delegation-compact tickets in the "t=" form.
|
||||
+/// Convert only where a ticket is sent to those services.
|
||||
pub fn store_ticket(ticket: String) -> String {
|
||||
match ticket.strip_prefix("d=") {
|
||||
Some(value) => format!("t={value}"),
|
||||
--- a/crates/xodus/src/models/licensing_ticket_tests.rs
|
||||
+++ b/crates/xodus/src/models/licensing_ticket_tests.rs
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Public synthetic data only, no account, keyring or network access.
|
||||
-use super::{Token, licensing_ticket, store_ticket};
|
||||
+use super::{Token, licensing_ticket, store_ticket, xbox_ticket};
|
||||
use crate::models::soap;
|
||||
use base64::{Engine, engine::general_purpose::URL_SAFE_NO_PAD};
|
||||
use serde_json::json;
|
||||
@@ -77,3 +77,35 @@
|
||||
let long_header = jwe(json!({"alg":"dir","enc":"A256GCM","kid":"a".repeat(9000)}), "");
|
||||
assert_eq!(licensing_ticket(format!("d={long_header}")), format!("t={long_header}"));
|
||||
}
|
||||
+
|
||||
+#[test]
|
||||
+fn credential_xbox_ticket_compact_jwe_uses_bare_wire_format_without_changing_store_conversion() {
|
||||
+ for raw in [
|
||||
+ jwe(json!({"alg":"dir","enc":"A128CBC-HS256"}), ""),
|
||||
+ jwe(json!({"alg":"RSA-OAEP-256","enc":"A256GCM"}), "a2V5"),
|
||||
+ ] {
|
||||
+ let Token::Compact(original) = delegation(&raw) else { panic!("fixture"); };
|
||||
+ assert_eq!(original, format!("d={raw}"));
|
||||
+ assert_eq!(store_ticket(original.clone()), format!("t={raw}"));
|
||||
+ assert_eq!(xbox_ticket(original), raw);
|
||||
+ assert_eq!(xbox_ticket(raw.clone()), raw);
|
||||
+ assert_eq!(xbox_ticket(format!("t={raw}")), format!("t={raw}"));
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+#[test]
|
||||
+fn credential_xbox_ticket_opaque_and_malformed_tokens_are_preserved() {
|
||||
+ let valid = jwe(json!({"alg":"dir","enc":"A256GCM"}), "");
|
||||
+ let mut cases = vec!["d=opaque".to_string(), "opaque".into(), "".into(), "d=".into(),
|
||||
+ "d=opaque..iv.ciphertext.tag".into(), "d=eyJ..a.b.c".into(),
|
||||
+ format!("d={valid}.extra"), format!("d={}", valid.replace("..", ".+.")),
|
||||
+ format!("d={}", jwe(json!({"alg":"dir"}), "")),
|
||||
+ format!("d={}", jwe(json!({"alg":"dir","enc":""}), "")),
|
||||
+ format!("d={}", jwe(json!({"alg":"dir","enc":"A256GCM","kid":"a".repeat(9000)}), ""))];
|
||||
+ let mut parts: Vec<_> = valid.split('.').map(str::to_string).collect();
|
||||
+ for index in [2, 3, 4] {
|
||||
+ let old = parts[index].clone(); parts[index].clear();
|
||||
+ cases.push(format!("d={}", parts.join("."))); parts[index] = old;
|
||||
+ }
|
||||
+ for ticket in cases { assert_eq!(xbox_ticket(ticket.clone()), ticket); }
|
||||
+}
|
||||
--- a/crates/xodus/src/api/xbox/auth.rs
|
||||
+++ b/crates/xodus/src/api/xbox/auth.rs
|
||||
@@ -12,7 +12,7 @@
|
||||
properties: UserAuthProperties {
|
||||
auth_method: "RPS".to_string(),
|
||||
site_name: "user.auth.xboxlive.com".to_string(),
|
||||
- rps_ticket,
|
||||
+ rps_ticket: crate::models::secrets::xbox_ticket(rps_ticket),
|
||||
},
|
||||
};
|
||||
|
||||
Loaded 100 of 101 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user