From 3b9f82152d65bef893fcf7fcf74300319671e0e9 Mon Sep 17 00:00:00 2001 From: Xenolphthalein <21215869+Xenolphthalein@users.noreply.github.com> Date: Wed, 2 Dec 2026 11:11:24 +0100 Subject: [PATCH 1/9] feat(overpressure-base): the updater's units: its steps for the session (polkit), and a daily check --- .../50-overpressure-base.preset | 1 + .../50-overpressure-update.rules | 14 ++++++ common/overpressure-base/PKGBUILD | 27 ++++++++--- .../overpressure-update-check.service | 13 +++++ .../overpressure-update-check.timer | 13 +++++ .../overpressure-update@.service | 15 ++++++ common/overpressure-base/test_config.py | 48 +++++++++++++++++++ 7 files changed, 125 insertions(+), 6 deletions(-) create mode 100644 common/overpressure-base/50-overpressure-update.rules create mode 100644 common/overpressure-base/overpressure-update-check.service create mode 100644 common/overpressure-base/overpressure-update-check.timer create mode 100644 common/overpressure-base/overpressure-update@.service diff --git a/common/overpressure-base/50-overpressure-base.preset b/common/overpressure-base/50-overpressure-base.preset index 810b14f..907e327 100644 --- a/common/overpressure-base/50-overpressure-base.preset +++ b/common/overpressure-base/50-overpressure-base.preset @@ -8,3 +8,4 @@ enable overpressure-storage-ro.service enable overpressure-usb-link.service enable overpressure-usb-internet.service enable overpressure-boot-ok.service +enable overpressure-update-check.timer diff --git a/common/overpressure-base/50-overpressure-update.rules b/common/overpressure-base/50-overpressure-update.rules new file mode 100644 index 0000000..52812bc --- /dev/null +++ b/common/overpressure-base/50-overpressure-update.rules @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: Unlicense +// The session's user (the active, local one: the headset's own session, whichever flavour names it) starts the +// updater's three steps without a password, as Overpressure Settings does; nothing else of systemd's units. +polkit.addRule(function (action, subject) { + var units = [ + "overpressure-update@check.service", + "overpressure-update@download.service", + "overpressure-update@install.service", + ]; + if (action.id === "org.freedesktop.systemd1.manage-units" && action.lookup("verb") === "start" && + units.indexOf(action.lookup("unit")) >= 0 && subject.local && subject.active) { + return polkit.Result.YES; + } +}); diff --git a/common/overpressure-base/PKGBUILD b/common/overpressure-base/PKGBUILD index b83bd2d..c4d2ef2 100644 --- a/common/overpressure-base/PKGBUILD +++ b/common/overpressure-base/PKGBUILD @@ -4,10 +4,12 @@ # gateway), steamos-readonly for an ext4 image, emergency and rescue back to the bootloader, and the system's # generic policy files. Its programs source the runtime's lib.sh, and the recovery deadline runs the runtime's # recovery-watch: the image build installs both from overpressure, as the maintenance system has them, with the -# headset's values in /etc/overpressure/headset. The preset enables the services; the tests run in the build. +# headset's values in /etc/overpressure/headset. The updater's units: its steps (overpressure-update@), which the +# session's user may start (its polkit rule), and its daily check. The preset enables the services and the timer; +# the tests run in the build. pkgname=overpressure-base pkgver=2026.12.2 -pkgrel=1 +pkgrel=2 pkgdesc="overpressure's installed system: preinit, storage and recovery policy, USB link" arch=(any) url="https://github.com/overpressure/overpressure/blob/main/docs/runtime.md" @@ -42,7 +44,11 @@ source=(50-overpressure-usb.conf test_config.py test_usb_internet.py test_boot_attempts.sh test_steamos_readonly.sh 50-overpressure-base.preset - 67-overpressure-language-fonts.conf) + 67-overpressure-language-fonts.conf + overpressure-update@.service + overpressure-update-check.service + overpressure-update-check.timer + 50-overpressure-update.rules) sha256sums=('952324c99b08f87f6d318258eb24915ed4f18a4f9fa219e756bbca70d5bd8396' '227246238bcba53b5610fde79395119e0915aefeba8d6184b5c6e59efdeb01d8' 'e490417b57d6b3bd5f59ddaeda87ba02ea1d38032c90678032cdfd471f0d5452' @@ -65,12 +71,16 @@ sha256sums=('952324c99b08f87f6d318258eb24915ed4f18a4f9fa219e756bbca70d5bd8396' '42e864cce089ddec10704c74a404d4713e9b1371284e88e29c8a396f43e0bf42' '7e2e20deeb0a824f77178be78dd3b52ba3b0eea92723b634279adc2c5e0d38b7' '3daf42f9b44dfcf6d4ae65018d633198503fa9071596c443a188fe37ec379d78' - 'fdca84ee896078af81ecf5f91b7f5863ea95e8c92001e353a928aebf2f8861a9' + 'de9a16bd6d0b9581918e7e9ac5f96cbe5497f43f8bd363213db528d6494e5445' 'f5f3580f84c53379b59a4de7aa206ba88975a439939a4b8eded66bd5dcced147' '7983dff5891f654806fdf7b0ac36683df4b13d8ae291e439c3a90ee5abb5ab4e' 'b45bf0dbde89f82a75cd782acce1773f1e2b7d2b0322d66be50c71782dac0eea' - '64a12dac4612f7020db4a355b0ed54618f5c80fa3a84f2607054b9f152fff01f' - '6875447f1422c4567a5fefbd2d525d0c55d0617d067ffe6e4f8b40a07506843f') + 'b8294486d9305db74506e5c60f54fa92cc0e81fd0472e5621b23516af019a3e7' + '6875447f1422c4567a5fefbd2d525d0c55d0617d067ffe6e4f8b40a07506843f' + 'a48b361bfebfabcea5ba0698fc88319d7bd997715dac37995caa4df6d935f0a1' + '62d7ecc367c5c8aa60ba16e9abc6d85200fb839d60547db5141b8d7a725a88b3' + '5a8041f96bf0c3f6a88d3477a38b4f5a272dc33cce9dbc29f828509b62c07f16' + '2a8a8885c7f8d594ede33a2de83b38df07953729a210856768c350c94452fd40') build() { python3 -B -m unittest test_config test_usb_internet @@ -105,4 +115,9 @@ package() { # The headset's preinit hooks (preinit's header). install -dm755 "$pkgdir/usr/lib/overpressure/preinit/early.d" "$pkgdir/usr/lib/overpressure/preinit/mounted.d" install -Dm644 50-overpressure-base.preset -t "$pkgdir/usr/lib/systemd/system-preset" + # The updater (overpressure-update, which the image build installs from overpressure): its steps, its daily + # check, and the rule that lets the session start the steps. + install -Dm644 overpressure-update@.service overpressure-update-check.service overpressure-update-check.timer \ + -t "$pkgdir/usr/lib/systemd/system" + install -Dm644 50-overpressure-update.rules "$pkgdir/usr/share/polkit-1/rules.d/50-overpressure-update.rules" } diff --git a/common/overpressure-base/overpressure-update-check.service b/common/overpressure-base/overpressure-update-check.service new file mode 100644 index 0000000..a033e2a --- /dev/null +++ b/common/overpressure-base/overpressure-update-check.service @@ -0,0 +1,13 @@ +# The daily check for a newer release (overpressure-update-check.timer): a check that fails, offline say, leaves the +# updater's status as it was. +[Unit] +Description=Check for a newer release of the headset's system +Documentation=https://github.com/overpressure/overpressure/blob/main/docs/internals/updates.md#the-updater +Wants=network-online.target +After=network-online.target + +[Service] +Type=oneshot +ExecStart=/usr/bin/overpressure-update check --scheduled +Nice=10 +IOSchedulingClass=idle diff --git a/common/overpressure-base/overpressure-update-check.timer b/common/overpressure-base/overpressure-update-check.timer new file mode 100644 index 0000000..0037cd9 --- /dev/null +++ b/common/overpressure-base/overpressure-update-check.timer @@ -0,0 +1,13 @@ +# A check for a newer release once a day, and after a start that missed one; spread over an hour, so that headsets +# do not all ask at once. Nothing is downloaded: the owner chooses that in Overpressure Settings. +[Unit] +Description=Check for a newer release of the headset's system daily + +[Timer] +OnCalendar=daily +Persistent=true +RandomizedDelaySec=1h +OnBootSec=10min + +[Install] +WantedBy=timers.target diff --git a/common/overpressure-base/overpressure-update@.service b/common/overpressure-base/overpressure-update@.service new file mode 100644 index 0000000..00bf2d6 --- /dev/null +++ b/common/overpressure-base/overpressure-update@.service @@ -0,0 +1,15 @@ +# A step of overpressure's updater (check, download or install: overpressure's docs/internals/updates.md, "The +# updater"), which Overpressure Settings starts for the session's user (50-overpressure-update.rules). A download +# runs on with the dashboard closed; install restarts into the recovery, which installs the update. +[Unit] +Description=overpressure's updater: %i +Documentation=https://github.com/overpressure/overpressure/blob/main/docs/internals/updates.md#the-updater +Wants=network-online.target +After=network-online.target + +[Service] +Type=oneshot +ExecStart=/usr/bin/overpressure-update %i +# Behind the session: the headset stays playable while it downloads. +Nice=10 +IOSchedulingClass=idle diff --git a/common/overpressure-base/test_config.py b/common/overpressure-base/test_config.py index 1c210fa..5c003f8 100644 --- a/common/overpressure-base/test_config.py +++ b/common/overpressure-base/test_config.py @@ -4,6 +4,7 @@ from __future__ import annotations import configparser +import re import unittest from pathlib import Path @@ -53,5 +54,52 @@ def test_no_key_in_the_package(self): self.assertEqual(names, []) +class UpdaterTests(unittest.TestCase): + """The updater's units and the rule that lets the session start its steps (overpressure's updates.md).""" + + STEPS = ("check", "download", "install") + + @staticmethod + def unit(name: str) -> configparser.ConfigParser: + config = configparser.ConfigParser(interpolation=None) # %i is systemd's + config.read_string((HERE / name).read_text(encoding="utf-8")) + return config + + def test_each_step_runs_the_updater_once_behind_the_session(self): + unit = self.unit("overpressure-update@.service") + self.assertEqual(unit["Service"]["Type"], "oneshot") + self.assertEqual(unit["Service"]["ExecStart"], "/usr/bin/overpressure-update %i") + self.assertEqual(unit["Service"]["IOSchedulingClass"], "idle") + self.assertIn("network-online.target", unit["Unit"]["After"]) + + def test_the_daily_check_fails_quietly_and_is_enabled(self): + check = self.unit("overpressure-update-check.service") + self.assertEqual(check["Service"]["ExecStart"], "/usr/bin/overpressure-update check --scheduled") + timer = self.unit("overpressure-update-check.timer") + self.assertEqual(timer["Timer"]["OnCalendar"], "daily") + self.assertEqual(timer["Timer"]["Persistent"], "true") + self.assertEqual(timer["Install"]["WantedBy"], "timers.target") + preset = (HERE / "50-overpressure-base.preset").read_text(encoding="utf-8").splitlines() + self.assertIn("enable overpressure-update-check.timer", preset) + self.assertNotIn("overpressure-update@", "\n".join(preset)) # the steps start when the owner asks + + def test_the_session_starts_the_three_steps_and_nothing_else(self): + rule = (HERE / "50-overpressure-update.rules").read_text(encoding="utf-8") + units = re.findall(r'"(overpressure-update@[a-z]+\.service)"', rule) + self.assertEqual(units, [f"overpressure-update@{step}.service" for step in self.STEPS]) + self.assertIn('action.id === "org.freedesktop.systemd1.manage-units"', rule) + self.assertIn('action.lookup("verb") === "start"', rule) + self.assertIn("subject.local && subject.active", rule) + self.assertEqual(rule.count("polkit.Result.YES"), 1) + self.assertNotIn("Result.AUTH", rule) + + def test_the_package_installs_them(self): + pkgbuild = (HERE / "PKGBUILD").read_text(encoding="utf-8") + for name in ("overpressure-update@.service", "overpressure-update-check.service", + "overpressure-update-check.timer", "50-overpressure-update.rules"): + self.assertIn(f" {name}", pkgbuild) + self.assertIn('"$pkgdir/usr/share/polkit-1/rules.d/50-overpressure-update.rules"', pkgbuild) + + if __name__ == "__main__": unittest.main() From 0af1aa180af2221f53067f129b6c21d4bf86252f Mon Sep 17 00:00:00 2001 From: Xenolphthalein <21215869+Xenolphthalein@users.noreply.github.com> Date: Wed, 2 Dec 2026 11:19:21 +0100 Subject: [PATCH 2/9] feat(pico4-monado): Updates in Overpressure Settings: the installed release, a newer one, its download, Restart and install --- phoenix/pico4-monado/PKGBUILD | 10 +- .../pico4-monado/overpressure-settings.cpp | 273 +++++++++- phoenix/pico4-monado/pico4-onboarding.strings | 496 ++++++++++++++++++ phoenix/pico4-monado/pico4_settings.h | 224 +++++++- phoenix/pico4-monado/test_pico4_settings.c | 53 +- 5 files changed, 1046 insertions(+), 10 deletions(-) diff --git a/phoenix/pico4-monado/PKGBUILD b/phoenix/pico4-monado/PKGBUILD index e85da31..edc0281 100644 --- a/phoenix/pico4-monado/PKGBUILD +++ b/phoenix/pico4-monado/PKGBUILD @@ -19,7 +19,7 @@ # overlays (Overpressure Settings' dashboard tab, the first-run setup). pkgname=pico4-monado pkgver=25.1.0 -pkgrel=22 +pkgrel=23 arch=(aarch64) url="https://monado.freedesktop.org" license=(BSL-1.0) @@ -92,9 +92,9 @@ sha256sums=(SKIP 'e160944ec154fa5caf43d2177396656c8561d1739df07510ce75c3b8ddafa3b3' '175f5769b65092ccd746309d6dcf9637b430960cc895b15ff103f8455b117bed' '22304e9a08ef83f9165f329ee704e342971a5d781add852af782474d320caed9' - 'ef439cd62f980ac666d74b0eca4b83ea8355bc89d9f702507a097e1d53ee1393' - '250d2c91cba27509443ca50b5422fb6aa6e9255bd28ddcbd1aa2d284a6c44973' - '906a7fc52e55a666645aa5ee3a66100e353134049f59558870c7005dc6c084ac' + '0837843da2fd5f28f3bf919910ad64663766dbbd8f39c3bda5ed4e4e8495093b' + '5ea6981182243c31ada826463a2fc8f50aaffa518d3ace015d7e4f1924740fa5' + '3c36731cd22a05b00a09b1439877b533f5fdcb9bd7beabd9a92ecea8c5d5ced7' '5cbe37ce8152ace06a53c6f0bec5b9fb6b639d9d2b86c6eb47864594112f87ab' '4b43cde5473deea834e49e02ca14c2fb01900d0bef88c7e6d2b6546fb56b80be' '7aafc2f95d382c3445c98e546f32a52464183b2b9d0e05c77398c7d011aed823' @@ -104,7 +104,7 @@ sha256sums=(SKIP 'fedc001568c106e488b26f2fd4418dd563351089c76af4d05c328d3cd1cf5c51' '4104d15d75e3dff32b8edf5779b9a73cacd85e5a36d6bd1a8c23f928889a3cc6' 'c282f2979f0785017a988bd439b928a733625b27417d3024e1d28f66531c91f1' - '44ca0d565fd8d0b1c2617d3351413ff0eed242b5daa0b8385edf1ee62f0936d7' + 'ab00d9349766f84b9972510ed513965b4ec19089f84cd7f3d34e41dbde6db8bb' 'cc727edbad724f50656255313d81ebc56dc6c168bbe05f10f8c57cfecd3829a4' '1e216b8317b7dcbdefb623a59dedf67ab580ffcfcd5b671a5420e777ce88aea9' '58f7dba6fbdb8473b6efffd4a31ce4ce32fd485d499355802ca850923e0bcfd6' diff --git a/phoenix/pico4-monado/overpressure-settings.cpp b/phoenix/pico4-monado/overpressure-settings.cpp index 819d18f..42bdc93 100644 --- a/phoenix/pico4-monado/overpressure-settings.cpp +++ b/phoenix/pico4-monado/overpressure-settings.cpp @@ -15,6 +15,11 @@ * to press. With no controller connected 20 s after the start, the laser cannot reach anything: * the page comes up in front of the wearer and the station listens for one controller after the * other. pico4-onboarding pairs them itself during the first-run setup. + * - Updates. The system's updates come from overpressure's updater, not Valve's: the installed + * release, a newer one on its channel with its notes, the download's progress (it goes on with the + * dashboard closed), Restart and install, and a failure's reason with Try again. The page reads + * `overpressure-update status` while it shows and starts the updater's units + * (overpressure-update@STEP.service), which the session may start (overpressure-base's polkit rule). * * In Steam's language, with the texts of pico4-onboarding.strings. Nothing of Valve's is linked: * libopenvr_api.so is opened at run time. @@ -29,8 +34,10 @@ #include #include +#include #include +#include namespace { @@ -78,14 +85,101 @@ struct Controllers int pressed = PICO4_CONTROLLERS_NONE; }; +//! A program run beside the loop: its output read as it comes, its end found without waiting. +struct Child +{ + pid_t pid = -1; + int fd = -1; + std::string out; + int status = -1; //!< its exit status once it ended; -1 for a signal + + //! Start @p argv (stdout kept with @p capture, else dropped); false when it could not start. + bool start(const char *const argv[], bool capture) + { + int p[2] = {-1, -1}; + if (capture && pipe2(p, O_CLOEXEC) != 0) { + return false; + } + pid = fork(); + if (pid == 0) { + const int null = open("/dev/null", O_RDWR); + dup2(capture ? p[1] : null, 1); + dup2(null, 2); + execvp(argv[0], const_cast(argv)); + _exit(127); + } + if (capture) { + close(p[1]); + if (pid < 0) { + close(p[0]); + } else { + fcntl(p[0], F_SETFL, O_NONBLOCK); + fd = p[0]; + } + } + out.clear(); + status = -1; + return pid > 0; + } + + //! True once it ended, in this call: its output is in out, its exit status in status. + bool poll() + { + if (pid <= 0) { + return false; + } + if (fd >= 0) { + char buf[4096]; + ssize_t n; + while ((n = read(fd, buf, sizeof(buf))) > 0) { + out.append(buf, (size_t)n); + } + if (n == 0) { + close(fd); + fd = -1; + } + } + int st; + if (fd >= 0 || waitpid(pid, &st, WNOHANG) != pid) { + return false; + } + pid = -1; + status = WIFEXITED(st) ? WEXITSTATUS(st) : -1; + return true; + } + + bool active() const { return pid > 0; } +}; + +struct Updates +{ + struct pico4_updates status = {}; + bool pressed = false; + const char *message = nullptr; //!< a failure's text key + Child reader; //!< overpressure-update status + Child starter; //!< systemctl start of a step's unit + double next = 0; //!< when to read the status again +}; + struct State { enum pico4_settings_page page = PICO4_SETTINGS_LENSES; int pressed_entry = PICO4_SETTINGS_NONE; Lenses lens; Controllers ctl; + Updates up; }; +//! Start the updater's step @p step (its unit, which the session may start), without waiting for it. +void +start_step(Updates &u, const char *step) +{ + const std::string unit = std::string("overpressure-update@") + step + ".service"; + const char *const argv[] = {"systemctl", "start", "--no-block", unit.c_str(), nullptr}; + u.message = u.starter.start(argv, false) ? nullptr : "updates_start_failed"; + u.next = 0; // its first status, now +} + std::string presets_path() { @@ -317,7 +411,97 @@ draw_controllers(cairo_t *c, const Controllers &s, const Texts &t, bool close, i } } -const char *const kPageTitles[PICO4_SETTINGS_PAGES] = {"setup_ipd_title", "controllers_title"}; +//! The updates' button's text key for the step @p action starts in @p u's state. +const char * +updates_button(const struct pico4_updates &u, const char *action) +{ + if (u.state == PICO4_UPDATES_FAILED) { + return "updates_retry"; + } + return strcmp(action, "download") == 0 ? "updates_download" : strcmp(action, "install") == 0 ? "updates_install" : "updates_check"; +} + +//! The updates' page, in the page's pixels from its margin. +void +draw_updates(cairo_t *c, const Updates &u, const Texts &t) +{ + const struct pico4_updates &s = u.status; + const double w = PICO4_UPDATES_W; + if (s.installed[0] != '\0') { + colour(c, kDim); + pico4_text::draw(c, fill(t.our("updates_installed"), s.installed), 0, 0, w, 22, false); + } + std::string head, body; + bool failed = false; + switch (s.state) { + case PICO4_UPDATES_IDLE: head = s.current ? t.our("updates_current") : ""; break; + case PICO4_UPDATES_CHECKING: head = t.our("updates_checking"); break; + case PICO4_UPDATES_AVAILABLE: + head = fill(t.our("updates_available"), s.title[0] != '\0' ? s.title : s.version); + body = s.notes; + break; + case PICO4_UPDATES_DOWNLOADING: head = fill(t.our("updates_downloading"), s.version); break; + case PICO4_UPDATES_READY: + head = fill(t.our("updates_ready"), s.version); + body = t.our("updates_ready_how"); + break; + case PICO4_UPDATES_INSTALLING: head = t.our("updates_installing"); break; + case PICO4_UPDATES_FAILED: + head = fill(t.our("updates_failed"), s.reason); + failed = true; + break; + default: head = "..."; break; + } + double y = 60; + if (failed) { + cairo_set_source_rgb(c, 0.95, 0.55, 0.45); + } else { + colour(c, kWhite); + } + if (!head.empty()) { + y += pico4_text::draw(c, head, 0, y, w, 30, true) + 24; + } + if (s.state == PICO4_UPDATES_DOWNLOADING) { + // The bar, its bytes, and that it goes on without the dashboard. + rounded(c, 0, y, w, 16, 8); + cairo_set_source_rgb(c, 0.30, 0.33, 0.37); + cairo_fill(c); + const double done = pico4_updates_fraction(&s); + if (done > 0) { + rounded(c, 0, y, w * done > 16 ? w * done : 16, 16, 8); + cairo_set_source_rgb(c, 0.27, 0.56, 0.90); + cairo_fill(c); + } + y += 34; + if (s.total > 0) { + char bytes[64]; + snprintf(bytes, sizeof(bytes), "%lld / %lld MB", s.done >> 20, s.total >> 20); + colour(c, kDim); + y += pico4_text::draw(c, bytes, 0, y, w, 22, false) + 20; + } + colour(c, kText); + pico4_text::draw(c, t.our("updates_background"), 0, y, w, 22, false); + } else if (!body.empty()) { + // A release's notes may run long: they stop above the button. + cairo_save(c); + cairo_rectangle(c, 0, y, w, PICO4_UPDATES_BUTTON_Y - 20 - y); + cairo_clip(c); + colour(c, kText); + pico4_text::draw(c, body, 0, y, w, 22, false); + cairo_restore(c); + } + const char *action = pico4_updates_action(&s); + if (action != nullptr) { + button(c, PICO4_UPDATES_BUTTON_X, PICO4_UPDATES_BUTTON_Y, PICO4_UPDATES_BUTTON_W, PICO4_UPDATES_BUTTON_H, + t.our(updates_button(s, action)), u.pressed, true); + } + if (u.message != nullptr) { + cairo_set_source_rgb(c, 0.95, 0.55, 0.45); + pico4_text::draw(c, t.our(u.message), 0, PICO4_UPDATES_BUTTON_Y + 20, PICO4_UPDATES_BUTTON_X - 20, 22, false); + } +} + +const char *const kPageTitles[PICO4_SETTINGS_PAGES] = {"setup_ipd_title", "controllers_title", "updates_title"}; void title(cairo_t *c, const std::string &text, double x, double w) @@ -355,9 +539,12 @@ draw_tab(cairo_surface_t *surface, const State &s, const Texts &t) cairo_translate(c, PICO4_SETTINGS_PAGE_X, PICO4_SETTINGS_PAGE_Y); if (s.page == PICO4_SETTINGS_LENSES) { draw_lenses(c, s.lens, t); - } else { + } else if (s.page == PICO4_SETTINGS_CONTROLLERS) { cairo_translate(c, PICO4_CONTROLLERS_MARGIN, 0); draw_controllers(c, s.ctl, t, false, PICO4_CONTROLLERS_NONE); + } else { + cairo_translate(c, PICO4_UPDATES_MARGIN, 0); + draw_updates(c, s.up, t); } cairo_restore(c); cairo_destroy(c); @@ -476,6 +663,34 @@ controllers_event(Controllers &s, const vr::VREvent_t &e, double x, double y, bo return PICO4_CONTROLLERS_NONE; } +//! A mouse event on the updates' page at (@p x, @p y) of the page; its button starts the next step. +bool +updates_event(Updates &u, const vr::VREvent_t &e, double x, double y) +{ + const char *action = pico4_updates_action(&u.status); + const bool on = pico4_updates_hit(x, y, action != nullptr); + if (e.eventType == vr::VREvent_MouseButtonDown) { + u.pressed = on; + return true; + } + if (e.eventType == vr::VREvent_MouseButtonUp) { + if (u.pressed && on && !u.starter.active()) { + start_step(u, action); + } + u.pressed = false; + return true; + } + return false; +} + +//! @p text into the status field @p field, cut to its size. +template +void +put(char (&field)[N], const char *text) +{ + snprintf(field, N, "%s", text); +} + int render(const char *dir, const char *language) { @@ -512,6 +727,35 @@ render(const char *dir, const char *language) s.ctl.hands_free = true; draw_front(front, s.ctl, t); save(front, "settings-front-pairing"); + // The updates' page in each state that shows more than a line. + s.page = PICO4_SETTINGS_UPDATES; + struct pico4_updates &u = s.up.status; + u.state = PICO4_UPDATES_AVAILABLE; + put(u.installed, "2026.12.0b1"); + put(u.version, "2026.12.0b2"); + put(u.title, "PICO 4 2026.12.0 beta 2"); + put(u.notes, "Changes\n- Updates from Overpressure Settings, over the headset's own network\n- The recovery installs a " + "signed update without a computer\n- Lens distance presets keep their place"); + draw_tab(tab, s, t); + save(tab, "settings-updates-available"); + u.state = PICO4_UPDATES_DOWNLOADING; + u.done = 1200ll << 20; + u.total = 2900ll << 20; + draw_tab(tab, s, t); + save(tab, "settings-updates-downloading"); + u.state = PICO4_UPDATES_READY; + draw_tab(tab, s, t); + save(tab, "settings-updates-ready"); + u.state = PICO4_UPDATES_FAILED; + put(u.step, "install"); + put(u.reason, "the battery is below 40 %: charge the headset or plug it in, then try again"); + draw_tab(tab, s, t); + save(tab, "settings-updates-failed"); + u.state = PICO4_UPDATES_IDLE; + u.current = true; + put(u.installed, "2026.12.0b2"); + draw_tab(tab, s, t); + save(tab, "settings-updates-current"); cairo_surface_destroy(tab); cairo_surface_destroy(front); return r; @@ -646,6 +890,8 @@ main(int argc, char **argv) } if (s.page == PICO4_SETTINGS_LENSES) { tab_dirty = lenses_event(l, e, px, py) || tab_dirty; + } else if (s.page == PICO4_SETTINGS_UPDATES) { + tab_dirty = updates_event(s.up, e, px - PICO4_UPDATES_MARGIN, py) || tab_dirty; } else if (e.eventType == vr::VREvent_MouseButtonDown || e.eventType == vr::VREvent_MouseButtonUp) { const int done = controllers_event(k, e, px - PICO4_CONTROLLERS_MARGIN, py, false); if (done == PICO4_CONTROLLERS_PAIR_LEFT || done == PICO4_CONTROLLERS_PAIR_RIGHT) { @@ -773,6 +1019,29 @@ main(int argc, char **argv) placement.follow(overlay, system, front, now); } + // The updater: its status every second while its page shows, and a step's start. + Updates &u = s.up; + if (u.starter.poll()) { + if (u.starter.status != 0) { + u.message = "updates_start_failed"; + } + u.next = 0; + tab_dirty = true; + } + if (visible && s.page == PICO4_SETTINGS_UPDATES && !u.reader.active() && now >= u.next) { + u.next = now + 1; + const char *const argv[] = {"overpressure-update", "status", nullptr}; + u.reader.start(argv, true); + } + if (u.reader.poll()) { + struct pico4_updates latest; + if (u.reader.status == 0 && pico4_updates_parse(u.reader.out.c_str(), &latest) && + memcmp(&latest, &u.status, sizeof(latest)) != 0) { + u.status = latest; + tab_dirty = true; + } + } + // Once before anyone looks, so that the tab never opens blank. if (tab_dirty && (visible || !drawn)) { drawn = true; diff --git a/phoenix/pico4-monado/pico4-onboarding.strings b/phoenix/pico4-monado/pico4-onboarding.strings index c095d71..408f688 100644 --- a/phoenix/pico4-monado/pico4-onboarding.strings +++ b/phoenix/pico4-monado/pico4-onboarding.strings @@ -45,6 +45,22 @@ lens_hint = Press a user to move the lenses. Hold it to store the distance. lens_move_failed = The lenses could not be moved. lens_not_reached = The lenses did not reach the distance. lens_store_failed = The distance could not be stored. +updates_title = Updates +updates_installed = Installed: %s +updates_check = Check for updates +updates_checking = Looking for a newer release… +updates_current = The system is up to date. +updates_available = %s is available. +updates_download = Download +updates_downloading = Downloading %s +updates_background = The download goes on when you close the dashboard. +updates_ready = %s is ready to install. +updates_ready_how = The headset restarts into overpressure recovery, which installs the update in about 20 minutes. Your games and data stay. It needs 40 % battery or the cable. +updates_install = Restart and install +updates_installing = Restarting into overpressure recovery… +updates_failed = That did not work: %s +updates_retry = Try again +updates_start_failed = The updater could not be started. [german] setup_welcome = Richten wir deine PICO 4 ein: Sprache, Zeitzone, WLAN, Controller und Linsen. @@ -86,6 +102,22 @@ lens_hint = Tippe eine Person an, um die Linsen zu bewegen. Halte sie, um den Ab lens_move_failed = Die Linsen konnten nicht bewegt werden. lens_not_reached = Die Linsen haben den Abstand nicht erreicht. lens_store_failed = Der Abstand konnte nicht gespeichert werden. +updates_title = Updates +updates_installed = Installiert: %s +updates_check = Nach Updates suchen +updates_checking = Suche nach einer neueren Version … +updates_current = Das System ist auf dem neuesten Stand. +updates_available = %s ist verfügbar. +updates_download = Herunterladen +updates_downloading = %s wird heruntergeladen +updates_background = Der Download läuft weiter, wenn du das Dashboard schließt. +updates_ready = %s ist bereit zur Installation. +updates_ready_how = Das Headset startet in die overpressure recovery neu, die das Update in etwa 20 Minuten installiert. Deine Spiele und Daten bleiben erhalten. Es braucht 40 % Akku oder das Kabel. +updates_install = Neu starten und installieren +updates_installing = Neustart in die overpressure recovery … +updates_failed = Das hat nicht geklappt: %s +updates_retry = Erneut versuchen +updates_start_failed = Die Aktualisierung konnte nicht gestartet werden. [french] setup_welcome = Configurons votre PICO 4 : langue, fuseau horaire, Wi-Fi, manettes et lentilles. @@ -127,6 +159,22 @@ lens_hint = Appuyez sur un utilisateur pour déplacer les lentilles. Maintenez-l lens_move_failed = Les lentilles n'ont pas pu être déplacées. lens_not_reached = Les lentilles n'ont pas atteint l'écart. lens_store_failed = L'écart n'a pas pu être enregistré. +updates_title = Mises à jour +updates_installed = Installé : %s +updates_check = Rechercher des mises à jour +updates_checking = Recherche d'une version plus récente… +updates_current = Le système est à jour. +updates_available = %s est disponible. +updates_download = Télécharger +updates_downloading = Téléchargement de %s +updates_background = Le téléchargement continue lorsque vous fermez le tableau de bord. +updates_ready = %s est prête à être installée. +updates_ready_how = Le casque redémarre dans overpressure recovery, qui installe la mise à jour en 20 minutes environ. Vos jeux et vos données sont conservés. Il faut 40 % de batterie ou le câble. +updates_install = Redémarrer et installer +updates_installing = Redémarrage dans overpressure recovery… +updates_failed = Cela n'a pas fonctionné : %s +updates_retry = Réessayer +updates_start_failed = La mise à jour n'a pas pu être lancée. [spanish] setup_welcome = Vamos a configurar tus PICO 4: idioma, zona horaria, wifi, mandos y lentes. @@ -168,6 +216,22 @@ lens_hint = Pulsa un usuario para mover las lentes. Mantenlo pulsado para guarda lens_move_failed = No se han podido mover las lentes. lens_not_reached = Las lentes no han llegado a la distancia. lens_store_failed = No se ha podido guardar la distancia. +updates_title = Actualizaciones +updates_installed = Instalada: %s +updates_check = Buscar actualizaciones +updates_checking = Buscando una versión más reciente… +updates_current = El sistema está actualizado. +updates_available = %s está disponible. +updates_download = Descargar +updates_downloading = Descargando %s +updates_background = La descarga continúa cuando cierras el panel. +updates_ready = %s está lista para instalarse. +updates_ready_how = El visor se reinicia en overpressure recovery, que instala la actualización en unos 20 minutos. Tus juegos y datos se conservan. Necesita un 40 % de batería o el cable. +updates_install = Reiniciar e instalar +updates_installing = Reiniciando en overpressure recovery… +updates_failed = No ha funcionado: %s +updates_retry = Reintentar +updates_start_failed = No se pudo iniciar el actualizador. [latam] setup_welcome = Configuremos tus PICO 4: idioma, zona horaria, wifi, controles y lentes. @@ -209,6 +273,22 @@ lens_hint = Presiona un usuario para mover los lentes. Mantenlo presionado para lens_move_failed = No se pudieron mover los lentes. lens_not_reached = Los lentes no llegaron a la distancia. lens_store_failed = No se pudo guardar la distancia. +updates_title = Actualizaciones +updates_installed = Instalada: %s +updates_check = Buscar actualizaciones +updates_checking = Buscando una versión más reciente… +updates_current = El sistema está actualizado. +updates_available = %s está disponible. +updates_download = Descargar +updates_downloading = Descargando %s +updates_background = La descarga continúa cuando cierras el panel. +updates_ready = %s está lista para instalarse. +updates_ready_how = El visor se reinicia en overpressure recovery, que instala la actualización en unos 20 minutos. Tus juegos y datos se conservan. Necesita 40 % de batería o el cable. +updates_install = Reiniciar e instalar +updates_installing = Reiniciando en overpressure recovery… +updates_failed = No funcionó: %s +updates_retry = Reintentar +updates_start_failed = No se pudo iniciar el actualizador. [italian] setup_welcome = Configuriamo il tuo PICO 4: lingua, fuso orario, Wi-Fi, controller e lenti. @@ -250,6 +330,22 @@ lens_hint = Premi un utente per spostare le lenti. Tienilo premuto per salvare l lens_move_failed = Impossibile spostare le lenti. lens_not_reached = Le lenti non hanno raggiunto la distanza. lens_store_failed = Impossibile salvare la distanza. +updates_title = Aggiornamenti +updates_installed = Installata: %s +updates_check = Cerca aggiornamenti +updates_checking = Ricerca di una versione più recente… +updates_current = Il sistema è aggiornato. +updates_available = %s è disponibile. +updates_download = Scarica +updates_downloading = Download di %s +updates_background = Il download prosegue quando chiudi la dashboard. +updates_ready = %s è pronta per l'installazione. +updates_ready_how = Il visore si riavvia in overpressure recovery, che installa l'aggiornamento in circa 20 minuti. Giochi e dati restano. Servono il 40 % di batteria o il cavo. +updates_install = Riavvia e installa +updates_installing = Riavvio in overpressure recovery… +updates_failed = Non ha funzionato: %s +updates_retry = Riprova +updates_start_failed = Impossibile avviare l'aggiornamento. [brazilian] setup_welcome = Vamos configurar seu PICO 4: idioma, fuso horário, Wi-Fi, controles e lentes. @@ -291,6 +387,22 @@ lens_hint = Toque em um usuário para mover as lentes. Segure para salvar a dist lens_move_failed = Não foi possível mover as lentes. lens_not_reached = As lentes não chegaram à distância. lens_store_failed = Não foi possível salvar a distância. +updates_title = Atualizações +updates_installed = Instalada: %s +updates_check = Procurar atualizações +updates_checking = Procurando uma versão mais recente… +updates_current = O sistema está atualizado. +updates_available = %s está disponível. +updates_download = Baixar +updates_downloading = Baixando %s +updates_background = O download continua quando você fecha o painel. +updates_ready = %s está pronta para instalar. +updates_ready_how = O headset reinicia no overpressure recovery, que instala a atualização em cerca de 20 minutos. Seus jogos e dados são mantidos. É preciso 40 % de bateria ou o cabo. +updates_install = Reiniciar e instalar +updates_installing = Reiniciando no overpressure recovery… +updates_failed = Não deu certo: %s +updates_retry = Tentar novamente +updates_start_failed = Não foi possível iniciar o atualizador. [portuguese] setup_welcome = Vamos configurar os seus PICO 4: idioma, fuso horário, Wi-Fi, comandos e lentes. @@ -332,6 +444,22 @@ lens_hint = Prima um utilizador para mover as lentes. Mantenha premido para guar lens_move_failed = Não foi possível mover as lentes. lens_not_reached = As lentes não chegaram à distância. lens_store_failed = Não foi possível guardar a distância. +updates_title = Atualizações +updates_installed = Instalada: %s +updates_check = Procurar atualizações +updates_checking = A procurar uma versão mais recente… +updates_current = O sistema está atualizado. +updates_available = %s está disponível. +updates_download = Transferir +updates_downloading = A transferir %s +updates_background = A transferência continua quando fecha o painel. +updates_ready = %s está pronta para ser instalada. +updates_ready_how = O headset reinicia no overpressure recovery, que instala a atualização em cerca de 20 minutos. Os seus jogos e dados mantêm-se. São precisos 40 % de bateria ou o cabo. +updates_install = Reiniciar e instalar +updates_installing = A reiniciar no overpressure recovery… +updates_failed = Não funcionou: %s +updates_retry = Tentar novamente +updates_start_failed = Não foi possível iniciar o atualizador. [dutch] setup_welcome = Laten we je PICO 4 instellen: taal, tijdzone, wifi, controllers en lenzen. @@ -373,6 +501,22 @@ lens_hint = Druk op een gebruiker om de lenzen te verplaatsen. Houd vast om de a lens_move_failed = De lenzen konden niet worden verplaatst. lens_not_reached = De lenzen hebben de afstand niet bereikt. lens_store_failed = De afstand kon niet worden opgeslagen. +updates_title = Updates +updates_installed = Geïnstalleerd: %s +updates_check = Zoeken naar updates +updates_checking = Zoeken naar een nieuwere versie… +updates_current = Het systeem is up-to-date. +updates_available = %s is beschikbaar. +updates_download = Downloaden +updates_downloading = %s wordt gedownload +updates_background = Het downloaden gaat door als je het dashboard sluit. +updates_ready = %s is klaar om te installeren. +updates_ready_how = De headset start opnieuw op in overpressure recovery, die de update in ongeveer 20 minuten installeert. Je games en gegevens blijven behouden. Er is 40 % batterij of de kabel nodig. +updates_install = Herstarten en installeren +updates_installing = Herstarten in overpressure recovery… +updates_failed = Dat is niet gelukt: %s +updates_retry = Opnieuw proberen +updates_start_failed = De updater kon niet worden gestart. [danish] setup_welcome = Lad os konfigurere dit PICO 4: sprog, tidszone, wi-fi, controllere og linser. @@ -414,6 +558,22 @@ lens_hint = Tryk på en bruger for at flytte linserne. Hold for at gemme afstand lens_move_failed = Linserne kunne ikke flyttes. lens_not_reached = Linserne nåede ikke afstanden. lens_store_failed = Afstanden kunne ikke gemmes. +updates_title = Opdateringer +updates_installed = Installeret: %s +updates_check = Søg efter opdateringer +updates_checking = Søger efter en nyere version … +updates_current = Systemet er opdateret. +updates_available = %s er tilgængelig. +updates_download = Download +updates_downloading = Downloader %s +updates_background = Downloaden fortsætter, når du lukker dashboardet. +updates_ready = %s er klar til installation. +updates_ready_how = Headsettet genstarter i overpressure recovery, som installerer opdateringen på cirka 20 minutter. Dine spil og data bevares. Det kræver 40 % batteri eller kablet. +updates_install = Genstart og installer +updates_installing = Genstarter i overpressure recovery … +updates_failed = Det lykkedes ikke: %s +updates_retry = Prøv igen +updates_start_failed = Opdateringen kunne ikke startes. [swedish] setup_welcome = Nu konfigurerar vi ditt PICO 4: språk, tidszon, wifi, handkontroller och linser. @@ -455,6 +615,22 @@ lens_hint = Tryck på en användare för att flytta linserna. Håll in för att lens_move_failed = Linserna kunde inte flyttas. lens_not_reached = Linserna nådde inte avståndet. lens_store_failed = Avståndet kunde inte sparas. +updates_title = Uppdateringar +updates_installed = Installerad: %s +updates_check = Sök efter uppdateringar +updates_checking = Söker efter en nyare version … +updates_current = Systemet är uppdaterat. +updates_available = %s är tillgänglig. +updates_download = Ladda ned +updates_downloading = Laddar ned %s +updates_background = Nedladdningen fortsätter när du stänger instrumentpanelen. +updates_ready = %s är redo att installeras. +updates_ready_how = Headsetet startar om i overpressure recovery, som installerar uppdateringen på ungefär 20 minuter. Dina spel och data finns kvar. Det behövs 40 % batteri eller kabeln. +updates_install = Starta om och installera +updates_installing = Startar om i overpressure recovery … +updates_failed = Det fungerade inte: %s +updates_retry = Försök igen +updates_start_failed = Uppdateringen kunde inte startas. [norwegian] setup_welcome = La oss sette opp PICO 4: språk, tidssone, wifi, kontrollere og linser. @@ -496,6 +672,22 @@ lens_hint = Trykk på en bruker for å flytte linsene. Hold inne for å lagre av lens_move_failed = Linsene kunne ikke flyttes. lens_not_reached = Linsene nådde ikke avstanden. lens_store_failed = Avstanden kunne ikke lagres. +updates_title = Oppdateringer +updates_installed = Installert: %s +updates_check = Se etter oppdateringer +updates_checking = Ser etter en nyere versjon … +updates_current = Systemet er oppdatert. +updates_available = %s er tilgjengelig. +updates_download = Last ned +updates_downloading = Laster ned %s +updates_background = Nedlastingen fortsetter når du lukker dashbordet. +updates_ready = %s er klar til å installeres. +updates_ready_how = Hodesettet starter på nytt i overpressure recovery, som installerer oppdateringen på omtrent 20 minutter. Spillene og dataene dine beholdes. Det trengs 40 % batteri eller kabelen. +updates_install = Start på nytt og installer +updates_installing = Starter på nytt i overpressure recovery … +updates_failed = Det fungerte ikke: %s +updates_retry = Prøv igjen +updates_start_failed = Oppdateringen kunne ikke startes. [finnish] setup_welcome = Otetaan PICO 4 käyttöön: kieli, aikavyöhyke, Wi-Fi, ohjaimet ja linssit. @@ -537,6 +729,22 @@ lens_hint = Siirrä linssejä painamalla käyttäjää. Tallenna etäisyys pitä lens_move_failed = Linssejä ei voitu siirtää. lens_not_reached = Linssit eivät saavuttaneet etäisyyttä. lens_store_failed = Etäisyyttä ei voitu tallentaa. +updates_title = Päivitykset +updates_installed = Asennettu: %s +updates_check = Etsi päivityksiä +updates_checking = Etsitään uudempaa versiota… +updates_current = Järjestelmä on ajan tasalla. +updates_available = %s on saatavilla. +updates_download = Lataa +updates_downloading = Ladataan: %s +updates_background = Lataus jatkuu, kun suljet hallintapaneelin. +updates_ready = %s on valmis asennettavaksi. +updates_ready_how = Lasit käynnistyvät uudelleen overpressure recoveryyn, joka asentaa päivityksen noin 20 minuutissa. Pelisi ja tietosi säilyvät. Akkua tarvitaan 40 % tai kaapeli. +updates_install = Käynnistä uudelleen ja asenna +updates_installing = Käynnistetään uudelleen overpressure recoveryyn… +updates_failed = Se ei onnistunut: %s +updates_retry = Yritä uudelleen +updates_start_failed = Päivitystä ei voitu käynnistää. [polish] setup_welcome = Skonfigurujmy PICO 4: język, strefę czasową, Wi-Fi, kontrolery i soczewki. @@ -578,6 +786,22 @@ lens_hint = Naciśnij użytkownika, aby przesunąć soczewki. Przytrzymaj, aby z lens_move_failed = Nie udało się przesunąć soczewek. lens_not_reached = Soczewki nie osiągnęły odległości. lens_store_failed = Nie udało się zapisać odległości. +updates_title = Aktualizacje +updates_installed = Zainstalowano: %s +updates_check = Sprawdź aktualizacje +updates_checking = Szukanie nowszej wersji… +updates_current = System jest aktualny. +updates_available = Dostępna jest wersja %s. +updates_download = Pobierz +updates_downloading = Pobieranie: %s +updates_background = Pobieranie trwa dalej po zamknięciu panelu. +updates_ready = Wersja %s jest gotowa do instalacji. +updates_ready_how = Gogle uruchomią się ponownie w overpressure recovery, które zainstaluje aktualizację w około 20 minut. Gry i dane zostają. Potrzeba 40 % baterii lub kabla. +updates_install = Uruchom ponownie i zainstaluj +updates_installing = Ponowne uruchamianie w overpressure recovery… +updates_failed = Nie udało się: %s +updates_retry = Spróbuj ponownie +updates_start_failed = Nie udało się uruchomić aktualizacji. [czech] setup_welcome = Pojďme nastavit vaše PICO 4: jazyk, časové pásmo, Wi-Fi, ovladače a čočky. @@ -619,6 +843,22 @@ lens_hint = Stiskněte uživatele, aby se čočky posunuly. Podržením uložít lens_move_failed = Čočky se nepodařilo posunout. lens_not_reached = Čočky nedosáhly vzdálenosti. lens_store_failed = Vzdálenost se nepodařilo uložit. +updates_title = Aktualizace +updates_installed = Nainstalováno: %s +updates_check = Vyhledat aktualizace +updates_checking = Hledá se novější verze… +updates_current = Systém je aktuální. +updates_available = Je k dispozici %s. +updates_download = Stáhnout +updates_downloading = Stahuje se %s +updates_background = Stahování pokračuje i po zavření panelu. +updates_ready = %s je připravena k instalaci. +updates_ready_how = Headset se restartuje do overpressure recovery, která aktualizaci nainstaluje asi za 20 minut. Hry a data zůstanou. Potřebuje 40 % baterie nebo kabel. +updates_install = Restartovat a nainstalovat +updates_installing = Restart do overpressure recovery… +updates_failed = Nepodařilo se: %s +updates_retry = Zkusit znovu +updates_start_failed = Aktualizaci se nepodařilo spustit. [hungarian] setup_welcome = Állítsuk be a PICO 4-et: nyelv, időzóna, Wi-Fi, kontrollerek és lencsék. @@ -660,6 +900,22 @@ lens_hint = Nyomj meg egy felhasználót a lencsék mozgatásához. Tartsd nyomv lens_move_failed = A lencséket nem sikerült mozgatni. lens_not_reached = A lencsék nem érték el a távolságot. lens_store_failed = A távolságot nem sikerült menteni. +updates_title = Frissítések +updates_installed = Telepítve: %s +updates_check = Frissítések keresése +updates_checking = Újabb kiadás keresése… +updates_current = A rendszer naprakész. +updates_available = Elérhető: %s. +updates_download = Letöltés +updates_downloading = Letöltés: %s +updates_background = A letöltés folytatódik, ha bezárod a vezérlőpultot. +updates_ready = A(z) %s telepítésre kész. +updates_ready_how = A headset újraindul az overpressure recoverybe, amely kb. 20 perc alatt telepíti a frissítést. A játékaid és adataid megmaradnak. 40 % töltöttség vagy a kábel szükséges. +updates_install = Újraindítás és telepítés +updates_installing = Újraindítás az overpressure recoverybe… +updates_failed = Nem sikerült: %s +updates_retry = Újra +updates_start_failed = A frissítőt nem sikerült elindítani. [romanian] setup_welcome = Să configurăm ochelarii PICO 4: limba, fusul orar, Wi-Fi, controlerele și lentilele. @@ -701,6 +957,22 @@ lens_hint = Apasă un utilizator pentru a mișca lentilele. Ține apăsat pentru lens_move_failed = Lentilele nu au putut fi mișcate. lens_not_reached = Lentilele nu au ajuns la distanță. lens_store_failed = Distanța nu a putut fi salvată. +updates_title = Actualizări +updates_installed = Instalată: %s +updates_check = Caută actualizări +updates_checking = Se caută o versiune mai nouă… +updates_current = Sistemul este actualizat. +updates_available = %s este disponibilă. +updates_download = Descarcă +updates_downloading = Se descarcă %s +updates_background = Descărcarea continuă când închizi panoul. +updates_ready = %s este gata de instalare. +updates_ready_how = Casca repornește în overpressure recovery, care instalează actualizarea în aproximativ 20 de minute. Jocurile și datele rămân. Are nevoie de 40 % baterie sau de cablu. +updates_install = Repornește și instalează +updates_installing = Se repornește în overpressure recovery… +updates_failed = Nu a funcționat: %s +updates_retry = Încearcă din nou +updates_start_failed = Actualizarea nu a putut fi pornită. [bulgarian] setup_welcome = Нека настроим PICO 4: език, часова зона, Wi-Fi, контролери и лещи. @@ -742,6 +1014,22 @@ lens_hint = Натиснете потребител, за да премести lens_move_failed = Лещите не можаха да се преместят. lens_not_reached = Лещите не достигнаха разстоянието. lens_store_failed = Разстоянието не можа да се запази. +updates_title = Актуализации +updates_installed = Инсталирана: %s +updates_check = Проверка за актуализации +updates_checking = Търсене на по-нова версия… +updates_current = Системата е актуална. +updates_available = Налична е %s. +updates_download = Изтегляне +updates_downloading = Изтегляне на %s +updates_background = Изтеглянето продължава, когато затвориш таблото. +updates_ready = %s е готова за инсталиране. +updates_ready_how = Шлемът се рестартира в overpressure recovery, което инсталира актуализацията за около 20 минути. Игрите и данните ти остават. Нужни са 40 % батерия или кабелът. +updates_install = Рестартиране и инсталиране +updates_installing = Рестартиране в overpressure recovery… +updates_failed = Не се получи: %s +updates_retry = Опитай отново +updates_start_failed = Актуализацията не можа да се стартира. [russian] setup_welcome = Давайте настроим PICO 4: язык, часовой пояс, Wi-Fi, контроллеры и линзы. @@ -783,6 +1071,22 @@ lens_hint = Нажмите на пользователя, чтобы сдвин lens_move_failed = Не удалось сдвинуть линзы. lens_not_reached = Линзы не дошли до расстояния. lens_store_failed = Не удалось сохранить расстояние. +updates_title = Обновления +updates_installed = Установлено: %s +updates_check = Проверить обновления +updates_checking = Поиск более новой версии… +updates_current = Система обновлена. +updates_available = Доступна версия %s. +updates_download = Загрузить +updates_downloading = Загрузка %s +updates_background = Загрузка продолжится, если закрыть панель. +updates_ready = %s готова к установке. +updates_ready_how = Гарнитура перезапустится в overpressure recovery, которое установит обновление примерно за 20 минут. Игры и данные сохранятся. Нужно 40 % заряда или кабель. +updates_install = Перезапустить и установить +updates_installing = Перезапуск в overpressure recovery… +updates_failed = Не получилось: %s +updates_retry = Повторить +updates_start_failed = Не удалось запустить обновление. [ukrainian] setup_welcome = Налаштуймо PICO 4: мову, часовий пояс, Wi-Fi, контролери та лінзи. @@ -824,6 +1128,22 @@ lens_hint = Натисніть користувача, щоб зсунути л lens_move_failed = Не вдалося зсунути лінзи. lens_not_reached = Лінзи не дійшли до відстані. lens_store_failed = Не вдалося зберегти відстань. +updates_title = Оновлення +updates_installed = Встановлено: %s +updates_check = Перевірити оновлення +updates_checking = Пошук новішої версії… +updates_current = Система оновлена. +updates_available = Доступна версія %s. +updates_download = Завантажити +updates_downloading = Завантаження %s +updates_background = Завантаження триває, коли ви закриваєте панель. +updates_ready = %s готова до встановлення. +updates_ready_how = Гарнітура перезапуститься в overpressure recovery, яке встановить оновлення приблизно за 20 хвилин. Ігри та дані залишаться. Потрібно 40 % заряду або кабель. +updates_install = Перезапустити й встановити +updates_installing = Перезапуск в overpressure recovery… +updates_failed = Не вдалося: %s +updates_retry = Спробувати ще раз +updates_start_failed = Не вдалося запустити оновлення. [greek] setup_welcome = Ας ρυθμίσουμε το PICO 4: γλώσσα, ζώνη ώρας, Wi-Fi, χειριστήρια και φακούς. @@ -865,6 +1185,22 @@ lens_hint = Πατήστε έναν χρήστη για να μετακινήσ lens_move_failed = Δεν ήταν δυνατή η μετακίνηση των φακών. lens_not_reached = Οι φακοί δεν έφτασαν την απόσταση. lens_store_failed = Δεν ήταν δυνατή η αποθήκευση της απόστασης. +updates_title = Ενημερώσεις +updates_installed = Εγκατεστημένη: %s +updates_check = Έλεγχος για ενημερώσεις +updates_checking = Αναζήτηση νεότερης έκδοσης… +updates_current = Το σύστημα είναι ενημερωμένο. +updates_available = Η έκδοση %s είναι διαθέσιμη. +updates_download = Λήψη +updates_downloading = Λήψη %s +updates_background = Η λήψη συνεχίζεται όταν κλείσεις τον πίνακα. +updates_ready = Η έκδοση %s είναι έτοιμη για εγκατάσταση. +updates_ready_how = Το headset επανεκκινεί στο overpressure recovery, που εγκαθιστά την ενημέρωση σε περίπου 20 λεπτά. Τα παιχνίδια και τα δεδομένα σου παραμένουν. Χρειάζεται 40 % μπαταρία ή το καλώδιο. +updates_install = Επανεκκίνηση και εγκατάσταση +updates_installing = Επανεκκίνηση στο overpressure recovery… +updates_failed = Δεν λειτούργησε: %s +updates_retry = Δοκίμασε ξανά +updates_start_failed = Η ενημέρωση δεν μπόρεσε να ξεκινήσει. [turkish] setup_welcome = PICO 4'ünüzü kuralım: dil, saat dilimi, Wi-Fi, kumandalar ve lensler. @@ -906,6 +1242,22 @@ lens_hint = Lensleri hareket ettirmek için bir kullanıcıya basın. Mesafeyi k lens_move_failed = Lensler hareket ettirilemedi. lens_not_reached = Lensler mesafeye ulaşmadı. lens_store_failed = Mesafe kaydedilemedi. +updates_title = Güncellemeler +updates_installed = Yüklü: %s +updates_check = Güncellemeleri denetle +updates_checking = Daha yeni bir sürüm aranıyor… +updates_current = Sistem güncel. +updates_available = %s kullanılabilir. +updates_download = İndir +updates_downloading = %s indiriliyor +updates_background = Paneli kapattığında indirme sürer. +updates_ready = %s yüklenmeye hazır. +updates_ready_how = Başlık overpressure recovery ile yeniden başlar; güncellemeyi yaklaşık 20 dakikada yükler. Oyunların ve verilerin korunur. %40 pil ya da kablo gerekir. +updates_install = Yeniden başlat ve yükle +updates_installing = overpressure recovery ile yeniden başlatılıyor… +updates_failed = Olmadı: %s +updates_retry = Yeniden dene +updates_start_failed = Güncelleyici başlatılamadı. [arabic] setup_welcome = لنُعدّ نظارة PICO 4: اللغة والمنطقة الزمنية وشبكة Wi-Fi ووحدات التحكم والعدسات. @@ -947,6 +1299,22 @@ lens_hint = اضغط على مستخدم لتحريك العدسات. اضغط lens_move_failed = تعذّر تحريك العدسات. lens_not_reached = لم تصل العدسات إلى المسافة. lens_store_failed = تعذّر حفظ المسافة. +updates_title = التحديثات +updates_installed = المثبَّت: %s +updates_check = البحث عن تحديثات +updates_checking = جارٍ البحث عن إصدار أحدث… +updates_current = النظام محدَّث. +updates_available = %s متاح. +updates_download = تنزيل +updates_downloading = جارٍ تنزيل %s +updates_background = يستمر التنزيل عند إغلاق لوحة التحكم. +updates_ready = %s جاهز للتثبيت. +updates_ready_how = يُعاد تشغيل السماعة في overpressure recovery الذي يثبّت التحديث في نحو 20 دقيقة. تبقى ألعابك وبياناتك. يلزم شحن 40 % أو الكابل. +updates_install = إعادة التشغيل والتثبيت +updates_installing = جارٍ إعادة التشغيل في overpressure recovery… +updates_failed = لم ينجح ذلك: %s +updates_retry = إعادة المحاولة +updates_start_failed = تعذّر بدء أداة التحديث. [japanese] setup_welcome = PICO 4 をセットアップしましょう:言語、タイムゾーン、Wi-Fi、コントローラー、レンズ。 @@ -988,6 +1356,22 @@ lens_hint = ユーザーを押すとレンズが動きます。長押しする lens_move_failed = レンズを動かせませんでした。 lens_not_reached = レンズがその間隔に届きませんでした。 lens_store_failed = 間隔を保存できませんでした。 +updates_title = アップデート +updates_installed = インストール済み: %s +updates_check = アップデートを確認 +updates_checking = 新しいリリースを確認しています… +updates_current = システムは最新です。 +updates_available = %s を利用できます。 +updates_download = ダウンロード +updates_downloading = %s をダウンロード中 +updates_background = ダッシュボードを閉じてもダウンロードは続きます。 +updates_ready = %s をインストールする準備ができました。 +updates_ready_how = ヘッドセットが overpressure recovery で再起動し、約 20 分でアップデートをインストールします。ゲームとデータはそのまま残ります。バッテリー残量 40 % 以上かケーブルが必要です。 +updates_install = 再起動してインストール +updates_installing = overpressure recovery で再起動しています… +updates_failed = うまくいきませんでした: %s +updates_retry = 再試行 +updates_start_failed = アップデーターを開始できませんでした。 [koreana] setup_welcome = PICO 4를 설정해 보겠습니다: 언어, 시간대, Wi-Fi, 컨트롤러, 렌즈. @@ -1029,6 +1413,22 @@ lens_hint = 사용자를 누르면 렌즈가 움직입니다. 길게 누르면 lens_move_failed = 렌즈를 움직이지 못했습니다. lens_not_reached = 렌즈가 그 간격에 도달하지 못했습니다. lens_store_failed = 간격을 저장하지 못했습니다. +updates_title = 업데이트 +updates_installed = 설치됨: %s +updates_check = 업데이트 확인 +updates_checking = 새 릴리스를 찾는 중… +updates_current = 시스템이 최신 상태입니다. +updates_available = %s을(를) 사용할 수 있습니다. +updates_download = 다운로드 +updates_downloading = %s 다운로드 중 +updates_background = 대시보드를 닫아도 다운로드가 계속됩니다. +updates_ready = %s을(를) 설치할 준비가 되었습니다. +updates_ready_how = 헤드셋이 overpressure recovery로 다시 시작되며, 약 20분 동안 업데이트를 설치합니다. 게임과 데이터는 그대로 유지됩니다. 배터리 40 % 이상 또는 케이블이 필요합니다. +updates_install = 다시 시작 및 설치 +updates_installing = overpressure recovery로 다시 시작하는 중… +updates_failed = 실패했습니다: %s +updates_retry = 다시 시도 +updates_start_failed = 업데이트 프로그램을 시작할 수 없습니다. [schinese] setup_welcome = 让我们来设置 PICO 4:语言、时区、Wi-Fi、手柄和镜片。 @@ -1070,6 +1470,22 @@ lens_hint = 按下一个用户即可移动镜片。长按可保存间距。 lens_move_failed = 无法移动镜片。 lens_not_reached = 镜片未到达该间距。 lens_store_failed = 无法保存间距。 +updates_title = 更新 +updates_installed = 已安装:%s +updates_check = 检查更新 +updates_checking = 正在查找更新的版本… +updates_current = 系统已是最新。 +updates_available = %s 可用。 +updates_download = 下载 +updates_downloading = 正在下载 %s +updates_background = 关闭仪表板后下载仍会继续。 +updates_ready = %s 已可安装。 +updates_ready_how = 头显会重启进入 overpressure recovery,约 20 分钟内安装更新。你的游戏和数据会保留。需要 40 % 电量或连接线缆。 +updates_install = 重启并安装 +updates_installing = 正在重启进入 overpressure recovery… +updates_failed = 未成功:%s +updates_retry = 重试 +updates_start_failed = 无法启动更新程序。 [tchinese] setup_welcome = 讓我們設定 PICO 4:語言、時區、Wi-Fi、控制器和鏡片。 @@ -1111,6 +1527,22 @@ lens_hint = 按下一位使用者即可移動鏡片。長按可儲存間距。 lens_move_failed = 無法移動鏡片。 lens_not_reached = 鏡片未到達該間距。 lens_store_failed = 無法儲存間距。 +updates_title = 更新 +updates_installed = 已安裝:%s +updates_check = 檢查更新 +updates_checking = 正在尋找較新的版本… +updates_current = 系統已是最新版本。 +updates_available = %s 可供使用。 +updates_download = 下載 +updates_downloading = 正在下載 %s +updates_background = 關閉控制面板後,下載仍會繼續。 +updates_ready = %s 已可安裝。 +updates_ready_how = 頭戴裝置會重新啟動進入 overpressure recovery,約 20 分鐘內安裝更新。你的遊戲與資料會保留。需要 40 % 電量或連接纜線。 +updates_install = 重新啟動並安裝 +updates_installing = 正在重新啟動進入 overpressure recovery… +updates_failed = 未成功:%s +updates_retry = 重試 +updates_start_failed = 無法啟動更新程式。 [thai] setup_welcome = มาตั้งค่า PICO 4 กัน: ภาษา เขตเวลา Wi-Fi คอนโทรลเลอร์ และเลนส์ @@ -1152,6 +1584,22 @@ lens_hint = กดผู้ใช้เพื่อขยับเลนส์ lens_move_failed = ขยับเลนส์ไม่ได้ lens_not_reached = เลนส์ไม่ถึงระยะห่างนั้น lens_store_failed = บันทึกระยะห่างไม่ได้ +updates_title = อัปเดต +updates_installed = ติดตั้งแล้ว: %s +updates_check = ตรวจหาอัปเดต +updates_checking = กำลังค้นหาเวอร์ชันที่ใหม่กว่า… +updates_current = ระบบเป็นเวอร์ชันล่าสุดแล้ว +updates_available = มี %s ให้ใช้งาน +updates_download = ดาวน์โหลด +updates_downloading = กำลังดาวน์โหลด %s +updates_background = การดาวน์โหลดจะดำเนินต่อเมื่อคุณปิดแดชบอร์ด +updates_ready = %s พร้อมติดตั้งแล้ว +updates_ready_how = ชุดหูฟังจะรีสตาร์ทเข้าสู่ overpressure recovery ซึ่งจะติดตั้งอัปเดตในเวลาประมาณ 20 นาที เกมและข้อมูลของคุณจะยังอยู่ ต้องมีแบตเตอรี่ 40 % หรือเสียบสาย +updates_install = รีสตาร์ทและติดตั้ง +updates_installing = กำลังรีสตาร์ทเข้าสู่ overpressure recovery… +updates_failed = ไม่สำเร็จ: %s +updates_retry = ลองอีกครั้ง +updates_start_failed = ไม่สามารถเริ่มตัวอัปเดตได้ [vietnamese] setup_welcome = Hãy thiết lập PICO 4: ngôn ngữ, múi giờ, Wi-Fi, tay cầm và thấu kính. @@ -1193,6 +1641,22 @@ lens_hint = Nhấn vào một người dùng để di chuyển thấu kính. Gi lens_move_failed = Không thể di chuyển thấu kính. lens_not_reached = Thấu kính chưa đạt tới khoảng cách. lens_store_failed = Không thể lưu khoảng cách. +updates_title = Cập nhật +updates_installed = Đã cài đặt: %s +updates_check = Kiểm tra cập nhật +updates_checking = Đang tìm phiên bản mới hơn… +updates_current = Hệ thống đã được cập nhật. +updates_available = Đã có %s. +updates_download = Tải xuống +updates_downloading = Đang tải xuống %s +updates_background = Việc tải xuống vẫn tiếp tục khi bạn đóng bảng điều khiển. +updates_ready = %s đã sẵn sàng để cài đặt. +updates_ready_how = Kính sẽ khởi động lại vào overpressure recovery để cài đặt bản cập nhật trong khoảng 20 phút. Trò chơi và dữ liệu của bạn được giữ nguyên. Cần 40 % pin hoặc cắm cáp. +updates_install = Khởi động lại và cài đặt +updates_installing = Đang khởi động lại vào overpressure recovery… +updates_failed = Không thành công: %s +updates_retry = Thử lại +updates_start_failed = Không thể khởi động trình cập nhật. [indonesian] setup_welcome = Mari siapkan PICO 4 Anda: bahasa, zona waktu, Wi-Fi, kontroler, dan lensa. @@ -1234,6 +1698,22 @@ lens_hint = Tekan pengguna untuk menggeser lensa. Tahan untuk menyimpan jaraknya lens_move_failed = Lensa tidak dapat digeser. lens_not_reached = Lensa tidak mencapai jarak tersebut. lens_store_failed = Jarak tidak dapat disimpan. +updates_title = Pembaruan +updates_installed = Terpasang: %s +updates_check = Periksa pembaruan +updates_checking = Mencari rilis yang lebih baru… +updates_current = Sistem sudah terbaru. +updates_available = %s tersedia. +updates_download = Unduh +updates_downloading = Mengunduh %s +updates_background = Unduhan tetap berjalan saat Anda menutup dasbor. +updates_ready = %s siap dipasang. +updates_ready_how = Headset dimulai ulang ke overpressure recovery, yang memasang pembaruan dalam sekitar 20 menit. Game dan data Anda tetap ada. Diperlukan baterai 40 % atau kabel. +updates_install = Mulai ulang dan pasang +updates_installing = Memulai ulang ke overpressure recovery… +updates_failed = Tidak berhasil: %s +updates_retry = Coba lagi +updates_start_failed = Pembaru tidak dapat dimulai. [malay] setup_welcome = Mari sediakan PICO 4 anda: bahasa, zon waktu, Wi-Fi, pengawal dan kanta. @@ -1275,3 +1755,19 @@ lens_hint = Tekan pengguna untuk menggerakkan kanta. Tahan untuk menyimpan jarak lens_move_failed = Kanta tidak dapat digerakkan. lens_not_reached = Kanta tidak mencapai jarak itu. lens_store_failed = Jarak tidak dapat disimpan. +updates_title = Kemas kini +updates_installed = Dipasang: %s +updates_check = Semak kemas kini +updates_checking = Mencari keluaran yang lebih baharu… +updates_current = Sistem sudah terkini. +updates_available = %s tersedia. +updates_download = Muat turun +updates_downloading = Memuat turun %s +updates_background = Muat turun diteruskan apabila anda menutup papan pemuka. +updates_ready = %s sedia untuk dipasang. +updates_ready_how = Set kepala dimulakan semula ke overpressure recovery, yang memasang kemas kini dalam kira-kira 20 minit. Permainan dan data anda kekal. Perlu bateri 40 % atau kabel. +updates_install = Mulakan semula dan pasang +updates_installing = Memulakan semula ke overpressure recovery… +updates_failed = Tidak berjaya: %s +updates_retry = Cuba lagi +updates_start_failed = Pengemas kini tidak dapat dimulakan. diff --git a/phoenix/pico4-monado/pico4_settings.h b/phoenix/pico4-monado/pico4_settings.h index 903f759..18e9965 100644 --- a/phoenix/pico4-monado/pico4_settings.h +++ b/phoenix/pico4-monado/pico4_settings.h @@ -4,13 +4,17 @@ * Overpressure Settings' layout and decisions (overpressure-settings.cpp), apart from SteamVR and * drawing so that the tests can reach them: a menu on the left, the chosen page on the right. Its * pages are what the PICO 4 cannot do the Steam Frame's way: the lenses have no wheel - * (pico4_lens_panel.h), and SteamVR cannot pair its controllers. + * (pico4_lens_panel.h), SteamVR cannot pair its controllers, and its system updates come from + * overpressure's updater (overpressure-update) rather than Valve's. */ #pragma once #include "pico4_lens_panel.h" #include +#include +#include +#include // The whole tab, in its pixels, y down; a page is PICO4_PANEL_W x PICO4_PANEL_H from its origin. #define PICO4_SETTINGS_W 1100 @@ -25,6 +29,7 @@ enum pico4_settings_page PICO4_SETTINGS_NONE = -1, PICO4_SETTINGS_LENSES, PICO4_SETTINGS_CONTROLLERS, + PICO4_SETTINGS_UPDATES, PICO4_SETTINGS_PAGES, }; @@ -102,3 +107,220 @@ pico4_settings_rescue(bool setup_pending, bool known, bool left, bool right, int { return !setup_pending && known && !left && !right && pairing == 0 && since_start >= wait_s; } + +/* + * The updates' page: overpressure-update's status (`overpressure-update status`, JSON: overpressure's + * docs/internals/updates.md, "The updater") and the one button that starts its next step. + */ +enum pico4_updates_state +{ + PICO4_UPDATES_UNKNOWN, //!< no status read yet, or one this page does not know + PICO4_UPDATES_IDLE, + PICO4_UPDATES_CHECKING, + PICO4_UPDATES_AVAILABLE, + PICO4_UPDATES_DOWNLOADING, + PICO4_UPDATES_READY, + PICO4_UPDATES_INSTALLING, + PICO4_UPDATES_FAILED, +}; + +struct pico4_updates +{ + enum pico4_updates_state state; + bool current; //!< idle after a check that found nothing newer + char installed[48], version[48], title[128], notes[640], reason[256], step[16]; + long long done, total; //!< a download's bytes +}; + +// The page, in the page's pixels from its 30 px margin: the text from the top, a download's bar, +// and the button at the bottom right. +#define PICO4_UPDATES_MARGIN 30.0 +#define PICO4_UPDATES_W (PICO4_PANEL_W - 2 * PICO4_UPDATES_MARGIN) +#define PICO4_UPDATES_BUTTON_W 330.0 +#define PICO4_UPDATES_BUTTON_H 70.0 +#define PICO4_UPDATES_BUTTON_X (PICO4_UPDATES_W - PICO4_UPDATES_BUTTON_W) +#define PICO4_UPDATES_BUTTON_Y 400.0 + +/*! + * The JSON string whose text starts at @p p (after its opening quote) into @p out (@p size bytes), + * its escapes decoded to UTF-8; false when it is cut off. Longer text is cut at @p size. + */ +static inline bool +pico4_json_string(const char *p, char *out, size_t size) +{ + size_t n = 0; + unsigned pending_high = 0; // a UTF-16 high surrogate waiting for its low half + for (; *p != '\0' && *p != '"'; p++) { + char put[4]; + size_t len = 1; + put[0] = *p; + if (*p == '\\') { + p++; + switch (*p) { + case 'n': put[0] = '\n'; break; + case 't': put[0] = '\t'; break; + case 'r': put[0] = '\r'; break; + case 'b': put[0] = '\b'; break; + case 'f': put[0] = '\f'; break; + case '"': case '\\': case '/': put[0] = *p; break; + case 'u': { + char hex[5] = {0}; + for (int i = 0; i < 4; i++) { + if (p[1 + i] == '\0') { + return false; + } + hex[i] = p[1 + i]; + } + p += 4; + unsigned cp = (unsigned)strtoul(hex, NULL, 16); + if (cp >= 0xD800 && cp < 0xDC00) { + pending_high = cp; + continue; + } + if (cp >= 0xDC00 && cp < 0xE000 && pending_high != 0) { + cp = 0x10000 + ((pending_high - 0xD800) << 10) + (cp - 0xDC00); + } + pending_high = 0; + if (cp < 0x80) { + put[0] = (char)cp; + } else if (cp < 0x800) { + put[0] = (char)(0xC0 | (cp >> 6)); + put[1] = (char)(0x80 | (cp & 0x3F)); + len = 2; + } else if (cp < 0x10000) { + put[0] = (char)(0xE0 | (cp >> 12)); + put[1] = (char)(0x80 | ((cp >> 6) & 0x3F)); + put[2] = (char)(0x80 | (cp & 0x3F)); + len = 3; + } else { + put[0] = (char)(0xF0 | (cp >> 18)); + put[1] = (char)(0x80 | ((cp >> 12) & 0x3F)); + put[2] = (char)(0x80 | ((cp >> 6) & 0x3F)); + put[3] = (char)(0x80 | (cp & 0x3F)); + len = 4; + } + break; + } + case '\0': return false; + default: put[0] = *p; break; + } + } + if (n + len < size) { + memcpy(out + n, put, len); + n += len; + } + } + if (size > 0) { + out[n < size ? n : size - 1] = '\0'; + } + return *p == '"'; +} + +/*! + * The value of the field @p key in @p json into @p out: a string's text, or a number's or a + * literal's (true, false). The status's keys are unique at every depth; a key inside a string is + * escaped there, so it is never taken for one. False without it. + */ +static inline bool +pico4_json_field(const char *json, const char *key, char *out, size_t size) +{ + char quoted[40]; + snprintf(quoted, sizeof(quoted), "\"%s\"", key); + for (const char *at = strstr(json, quoted); at != NULL; at = strstr(at + 1, quoted)) { + if (at > json && at[-1] == '\\') { + continue; + } + const char *p = at + strlen(quoted); + while (*p == ' ' || *p == '\t' || *p == '\n' || *p == '\r') { + p++; + } + if (*p != ':') { + continue; + } + p++; + while (*p == ' ' || *p == '\t' || *p == '\n' || *p == '\r') { + p++; + } + if (*p == '"') { + return pico4_json_string(p + 1, out, size); + } + size_t n = 0; + while (p[n] != '\0' && p[n] != ',' && p[n] != '}' && p[n] != ']' && p[n] != '\n' && p[n] != ' ') { + n++; + } + if (n == 0 || n >= size) { + return false; + } + memcpy(out, p, n); + out[n] = '\0'; + return true; + } + return false; +} + +//! @p json, overpressure-update's status, into @p u; false when it names no state. +static inline bool +pico4_updates_parse(const char *json, struct pico4_updates *u) +{ + static const char *const names[] = {"", "idle", "checking", "available", "downloading", "ready", "installing", "failed"}; + char state[24], number[32]; + memset(u, 0, sizeof(*u)); + if (!pico4_json_field(json, "state", state, sizeof(state))) { + return false; + } + for (int i = 1; i < (int)(sizeof(names) / sizeof(names[0])); i++) { + if (strcmp(state, names[i]) == 0) { + u->state = (enum pico4_updates_state)i; + } + } + u->current = pico4_json_field(json, "current", number, sizeof(number)) && strcmp(number, "true") == 0; + pico4_json_field(json, "installed", u->installed, sizeof(u->installed)); + pico4_json_field(json, "version", u->version, sizeof(u->version)); + pico4_json_field(json, "title", u->title, sizeof(u->title)); + pico4_json_field(json, "notes", u->notes, sizeof(u->notes)); + pico4_json_field(json, "reason", u->reason, sizeof(u->reason)); + pico4_json_field(json, "step", u->step, sizeof(u->step)); + if (pico4_json_field(json, "done", number, sizeof(number))) { + u->done = atoll(number); + } + if (pico4_json_field(json, "total", number, sizeof(number))) { + u->total = atoll(number); + } + return true; +} + +/*! + * The step the page's button starts in @p u's state ("check", "download" or "install"; after a + * failure the step that failed again), NULL while a step runs or nothing is known. + */ +static inline const char * +pico4_updates_action(const struct pico4_updates *u) +{ + switch (u->state) { + case PICO4_UPDATES_IDLE: return "check"; + case PICO4_UPDATES_AVAILABLE: return "download"; + case PICO4_UPDATES_READY: return "install"; + case PICO4_UPDATES_FAILED: + return strcmp(u->step, "download") == 0 ? "download" : strcmp(u->step, "install") == 0 ? "install" : "check"; + default: return NULL; + } +} + +//! A download's share done, 0 to 1 (0 while its size is unknown). +static inline double +pico4_updates_fraction(const struct pico4_updates *u) +{ + if (u->total <= 0) { + return 0; + } + const double f = (double)u->done / (double)u->total; + return f < 0 ? 0 : f > 1 ? 1 : f; +} + +//! Whether (@p x, @p y) of the updates' page is on its button, where it is @p shown. +static inline bool +pico4_updates_hit(double x, double y, bool shown) +{ + return shown && x >= PICO4_UPDATES_BUTTON_X && x < PICO4_UPDATES_BUTTON_X + PICO4_UPDATES_BUTTON_W && + y >= PICO4_UPDATES_BUTTON_Y && y < PICO4_UPDATES_BUTTON_Y + PICO4_UPDATES_BUTTON_H; +} diff --git a/phoenix/pico4-monado/test_pico4_settings.c b/phoenix/pico4-monado/test_pico4_settings.c index a9a5fac..8c943f2 100644 --- a/phoenix/pico4-monado/test_pico4_settings.c +++ b/phoenix/pico4-monado/test_pico4_settings.c @@ -2,7 +2,7 @@ // SPDX-License-Identifier: BSL-1.0 /* * Overpressure Settings' menu, its controllers' page and when that page comes up in front of the - * wearer. + * wearer, and its updates' page: the updater's status read, and the step its button starts. */ #include "pico4_pairing.h" #include "pico4_settings.h" @@ -25,8 +25,11 @@ main(void) // The menu: one entry per page, nothing between or below them, nothing on the page side. EXPECT(pico4_settings_menu_hit(100, 120) == PICO4_SETTINGS_LENSES); EXPECT(pico4_settings_menu_hit(100, 200) == PICO4_SETTINGS_CONTROLLERS); + EXPECT(pico4_settings_menu_hit(100, 280) == PICO4_SETTINGS_UPDATES); EXPECT(pico4_settings_menu_hit(100, 180) == PICO4_SETTINGS_NONE); - EXPECT(pico4_settings_menu_hit(100, 300) == PICO4_SETTINGS_NONE); + EXPECT(pico4_settings_menu_hit(100, 256) == PICO4_SETTINGS_NONE); + EXPECT(pico4_settings_menu_hit(100, 360) == PICO4_SETTINGS_NONE); + EXPECT(PICO4_SETTINGS_ENTRY_Y + PICO4_SETTINGS_PAGES * PICO4_SETTINGS_ENTRY_STEP <= PICO4_SETTINGS_H); EXPECT(pico4_settings_menu_hit(100, 60) == PICO4_SETTINGS_NONE); EXPECT(pico4_settings_menu_hit(400, 120) == PICO4_SETTINGS_NONE); // Both pages fit beside the menu. @@ -51,6 +54,52 @@ main(void) EXPECT(!pico4_settings_rescue(false, true, false, false, 1, 25, PICO4_PAIRING_WAIT_S)); EXPECT(!pico4_settings_rescue(false, true, false, false, 0, 5, PICO4_PAIRING_WAIT_S)); + // The updater's status, as overpressure-update status prints it (json.dumps, indent 1, keys sorted, ASCII). + struct pico4_updates u; + EXPECT(pico4_updates_parse("{\n \"available\": {\n \"bytes\": 10240,\n \"notes\": \"Changes\\n- \\\"fast\\\" \\u00fcber \\u20ac \\ud83d\\ude00\",\n" + " \"title\": \"PICO 4 2026.12.0 beta 2\",\n \"version\": \"2026.12.0b2\"\n },\n" + " \"installed\": \"2026.12.0b1\",\n \"pid\": 42,\n \"state\": \"available\",\n \"time\": 1796167985\n}\n", + &u)); + EXPECT(u.state == PICO4_UPDATES_AVAILABLE); + EXPECT(strcmp(u.installed, "2026.12.0b1") == 0); + EXPECT(strcmp(u.version, "2026.12.0b2") == 0); + EXPECT(strcmp(u.title, "PICO 4 2026.12.0 beta 2") == 0); + EXPECT(strcmp(u.notes, "Changes\n- \"fast\" \xC3\xBC" "ber \xE2\x82\xAC \xF0\x9F\x98\x80") == 0); + EXPECT(strcmp(pico4_updates_action(&u), "download") == 0); + EXPECT(!u.current); + // A download's bytes; no button while it runs. + EXPECT(pico4_updates_parse("{\"done\": 1048576, \"part\": \"packages\", \"state\": \"downloading\", \"total\": 4194304}", &u)); + EXPECT(u.state == PICO4_UPDATES_DOWNLOADING && u.done == 1048576 && u.total == 4194304); + EXPECT(pico4_updates_fraction(&u) == 0.25); + EXPECT(pico4_updates_action(&u) == NULL); + // Idle after a check: Check again; ready: Restart and install; installing: nothing. + EXPECT(pico4_updates_parse("{\"current\": true, \"installed\": \"2026.12.0b2\", \"state\": \"idle\"}", &u)); + EXPECT(u.current && strcmp(pico4_updates_action(&u), "check") == 0); + EXPECT(pico4_updates_fraction(&u) == 0); + EXPECT(pico4_updates_parse("{\"available\": {\"version\": \"2026.12.0b2\"}, \"state\": \"ready\"}", &u)); + EXPECT(strcmp(pico4_updates_action(&u), "install") == 0 && strcmp(u.version, "2026.12.0b2") == 0); + EXPECT(pico4_updates_parse("{\"state\": \"installing\"}", &u) && pico4_updates_action(&u) == NULL); + // A failure: its reason, and the step that failed again. + EXPECT(pico4_updates_parse("{\"reason\": \"the battery is below 40 %\", \"state\": \"failed\", \"step\": \"install\"}", &u)); + EXPECT(strcmp(u.reason, "the battery is below 40 %") == 0 && strcmp(pico4_updates_action(&u), "install") == 0); + EXPECT(pico4_updates_parse("{\"reason\": \"the step stopped\", \"state\": \"failed\"}", &u)); + EXPECT(strcmp(pico4_updates_action(&u), "check") == 0); + // A key inside a string is no key; an unknown state, no state, cut-off text. + EXPECT(pico4_updates_parse("{\"reason\": \"\\\"state\\\": \\\"ready\\\"\", \"state\": \"checking\"}", &u)); + EXPECT(u.state == PICO4_UPDATES_CHECKING && strcmp(u.reason, "\"state\": \"ready\"") == 0); + EXPECT(pico4_updates_parse("{\"state\": \"later\"}", &u) && u.state == PICO4_UPDATES_UNKNOWN && pico4_updates_action(&u) == NULL); + EXPECT(!pico4_updates_parse("{}", &u)); + EXPECT(!pico4_updates_parse("", &u)); + char cut[8]; + EXPECT(!pico4_json_field("{\"title\": \"no end", "title", cut, sizeof(cut))); + EXPECT(pico4_json_field("{\"title\": \"a long title\"}", "title", cut, sizeof(cut)) && strcmp(cut, "a long ") == 0); + // The button fits on the page, and only where it is shown. + EXPECT(PICO4_UPDATES_BUTTON_Y + PICO4_UPDATES_BUTTON_H <= PICO4_PANEL_H); + EXPECT(PICO4_UPDATES_BUTTON_X >= 0); + EXPECT(pico4_updates_hit(PICO4_UPDATES_BUTTON_X + 10, PICO4_UPDATES_BUTTON_Y + 10, true)); + EXPECT(!pico4_updates_hit(PICO4_UPDATES_BUTTON_X + 10, PICO4_UPDATES_BUTTON_Y + 10, false)); + EXPECT(!pico4_updates_hit(PICO4_UPDATES_BUTTON_X - 10, PICO4_UPDATES_BUTTON_Y + 10, true)); + if (failures != 0) { printf("%d failure(s)\n", failures); return 1; From a5cb948dfd40fe1161ec7c8169c025a5bae75960 Mon Sep 17 00:00:00 2001 From: Xenolphthalein <21215869+Xenolphthalein@users.noreply.github.com> Date: Wed, 2 Dec 2026 14:00:27 +0100 Subject: [PATCH 3/9] fix(overpressure-base): the updater's steps start at once, without waiting for network-online.target --- common/overpressure-base/PKGBUILD | 6 +++--- common/overpressure-base/overpressure-update-check.service | 2 -- common/overpressure-base/overpressure-update@.service | 4 ++-- common/overpressure-base/test_config.py | 5 ++++- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/common/overpressure-base/PKGBUILD b/common/overpressure-base/PKGBUILD index c4d2ef2..fd0ce75 100644 --- a/common/overpressure-base/PKGBUILD +++ b/common/overpressure-base/PKGBUILD @@ -71,14 +71,14 @@ sha256sums=('952324c99b08f87f6d318258eb24915ed4f18a4f9fa219e756bbca70d5bd8396' '42e864cce089ddec10704c74a404d4713e9b1371284e88e29c8a396f43e0bf42' '7e2e20deeb0a824f77178be78dd3b52ba3b0eea92723b634279adc2c5e0d38b7' '3daf42f9b44dfcf6d4ae65018d633198503fa9071596c443a188fe37ec379d78' - 'de9a16bd6d0b9581918e7e9ac5f96cbe5497f43f8bd363213db528d6494e5445' + '39cdf80928754e7e952cd75608a56f2ed2154351d6a5ba30abfa254c16396c59' 'f5f3580f84c53379b59a4de7aa206ba88975a439939a4b8eded66bd5dcced147' '7983dff5891f654806fdf7b0ac36683df4b13d8ae291e439c3a90ee5abb5ab4e' 'b45bf0dbde89f82a75cd782acce1773f1e2b7d2b0322d66be50c71782dac0eea' 'b8294486d9305db74506e5c60f54fa92cc0e81fd0472e5621b23516af019a3e7' '6875447f1422c4567a5fefbd2d525d0c55d0617d067ffe6e4f8b40a07506843f' - 'a48b361bfebfabcea5ba0698fc88319d7bd997715dac37995caa4df6d935f0a1' - '62d7ecc367c5c8aa60ba16e9abc6d85200fb839d60547db5141b8d7a725a88b3' + 'ab59e4ee787a31adfdd29537bceceb7b9ab411ef588147298de62e3207df99ea' + '4ebc1f7eff4e2f5ed36bce4df967b584a1c005d77fcc8aff961962ed09049551' '5a8041f96bf0c3f6a88d3477a38b4f5a272dc33cce9dbc29f828509b62c07f16' '2a8a8885c7f8d594ede33a2de83b38df07953729a210856768c350c94452fd40') diff --git a/common/overpressure-base/overpressure-update-check.service b/common/overpressure-base/overpressure-update-check.service index a033e2a..a04dfbc 100644 --- a/common/overpressure-base/overpressure-update-check.service +++ b/common/overpressure-base/overpressure-update-check.service @@ -3,8 +3,6 @@ [Unit] Description=Check for a newer release of the headset's system Documentation=https://github.com/overpressure/overpressure/blob/main/docs/internals/updates.md#the-updater -Wants=network-online.target -After=network-online.target [Service] Type=oneshot diff --git a/common/overpressure-base/overpressure-update@.service b/common/overpressure-base/overpressure-update@.service index 00bf2d6..83602c8 100644 --- a/common/overpressure-base/overpressure-update@.service +++ b/common/overpressure-base/overpressure-update@.service @@ -1,11 +1,11 @@ # A step of overpressure's updater (check, download or install: overpressure's docs/internals/updates.md, "The # updater"), which Overpressure Settings starts for the session's user (50-overpressure-update.rules). A download # runs on with the dashboard closed; install restarts into the recovery, which installs the update. +# It starts at once, without network-online.target (networkd's wait times out on the USB link): the updater reads +# no network as a refusal with its reason. [Unit] Description=overpressure's updater: %i Documentation=https://github.com/overpressure/overpressure/blob/main/docs/internals/updates.md#the-updater -Wants=network-online.target -After=network-online.target [Service] Type=oneshot diff --git a/common/overpressure-base/test_config.py b/common/overpressure-base/test_config.py index 5c003f8..313a279 100644 --- a/common/overpressure-base/test_config.py +++ b/common/overpressure-base/test_config.py @@ -70,7 +70,10 @@ def test_each_step_runs_the_updater_once_behind_the_session(self): self.assertEqual(unit["Service"]["Type"], "oneshot") self.assertEqual(unit["Service"]["ExecStart"], "/usr/bin/overpressure-update %i") self.assertEqual(unit["Service"]["IOSchedulingClass"], "idle") - self.assertIn("network-online.target", unit["Unit"]["After"]) + # At once when pressed: no wait for network-online.target, which networkd may hold for minutes. + for name in ("overpressure-update@.service", "overpressure-update-check.service"): + waits = [self.unit(name)["Unit"].get(key, "") for key in ("After", "Wants", "Requires")] + self.assertFalse([w for w in waits if "network-online" in w], name) def test_the_daily_check_fails_quietly_and_is_enabled(self): check = self.unit("overpressure-update-check.service") From f306fad2f837e565d28f9f3e498f06af5f422ce1 Mon Sep 17 00:00:00 2001 From: Xenolphthalein <21215869+Xenolphthalein@users.noreply.github.com> Date: Wed, 2 Dec 2026 14:00:28 +0100 Subject: [PATCH 4/9] fix(pico4-monado): the Updates page shows a step at once, names the download's part in a fitting unit, and moves while it cannot measure --- phoenix/pico4-monado/PKGBUILD | 8 +- .../pico4-monado/overpressure-settings.cpp | 109 +++++++++++++++--- phoenix/pico4-monado/pico4-onboarding.strings | 93 +++++++++++++++ phoenix/pico4-monado/pico4_settings.h | 42 ++++++- phoenix/pico4-monado/test_pico4_settings.c | 21 ++++ 5 files changed, 250 insertions(+), 23 deletions(-) diff --git a/phoenix/pico4-monado/PKGBUILD b/phoenix/pico4-monado/PKGBUILD index edc0281..1dff7f0 100644 --- a/phoenix/pico4-monado/PKGBUILD +++ b/phoenix/pico4-monado/PKGBUILD @@ -92,9 +92,9 @@ sha256sums=(SKIP 'e160944ec154fa5caf43d2177396656c8561d1739df07510ce75c3b8ddafa3b3' '175f5769b65092ccd746309d6dcf9637b430960cc895b15ff103f8455b117bed' '22304e9a08ef83f9165f329ee704e342971a5d781add852af782474d320caed9' - '0837843da2fd5f28f3bf919910ad64663766dbbd8f39c3bda5ed4e4e8495093b' - '5ea6981182243c31ada826463a2fc8f50aaffa518d3ace015d7e4f1924740fa5' - '3c36731cd22a05b00a09b1439877b533f5fdcb9bd7beabd9a92ecea8c5d5ced7' + '96250102f5a1a6f73ef47f973a1f8af675889b78a07b22c26fe2a945f6b27acf' + '051ee5e8391e842cb4b0532b0f248d1b2f283d3c9ffaf2391b1177b3cb0f7d17' + '9f2b2c05e15c82059cfb5a9a019ae7e66390f228ef16a2a2ae5c10d9af0fc0d8' '5cbe37ce8152ace06a53c6f0bec5b9fb6b639d9d2b86c6eb47864594112f87ab' '4b43cde5473deea834e49e02ca14c2fb01900d0bef88c7e6d2b6546fb56b80be' '7aafc2f95d382c3445c98e546f32a52464183b2b9d0e05c77398c7d011aed823' @@ -104,7 +104,7 @@ sha256sums=(SKIP 'fedc001568c106e488b26f2fd4418dd563351089c76af4d05c328d3cd1cf5c51' '4104d15d75e3dff32b8edf5779b9a73cacd85e5a36d6bd1a8c23f928889a3cc6' 'c282f2979f0785017a988bd439b928a733625b27417d3024e1d28f66531c91f1' - 'ab00d9349766f84b9972510ed513965b4ec19089f84cd7f3d34e41dbde6db8bb' + '19afb4c2e2d499dad81ac3cf4b186f3f5fdf931f9e8faf92d0211cf5dc4b31ae' 'cc727edbad724f50656255313d81ebc56dc6c168bbe05f10f8c57cfecd3829a4' '1e216b8317b7dcbdefb623a59dedf67ab580ffcfcd5b671a5420e777ce88aea9' '58f7dba6fbdb8473b6efffd4a31ce4ce32fd485d499355802ca850923e0bcfd6' diff --git a/phoenix/pico4-monado/overpressure-settings.cpp b/phoenix/pico4-monado/overpressure-settings.cpp index 42bdc93..160a3a0 100644 --- a/phoenix/pico4-monado/overpressure-settings.cpp +++ b/phoenix/pico4-monado/overpressure-settings.cpp @@ -159,8 +159,23 @@ struct Updates Child reader; //!< overpressure-update status Child starter; //!< systemctl start of a step's unit double next = 0; //!< when to read the status again + long long started = 0; //!< when a step's button was let go (seconds since 1970), until the updater answers + double animated = 0; //!< when the moving bar was last drawn }; +//! Seconds a step shows from its press without the updater's word, before the old status counts again. +constexpr long long kStepHold = 10; +//! Seconds between frames of the moving bar. +constexpr double kAnimation = 1.0 / 15; + +//! Whether the page shows a moving bar: a step whose progress cannot be measured (yet). +bool +updates_moving(const struct pico4_updates &s) +{ + return s.state == PICO4_UPDATES_CHECKING || s.state == PICO4_UPDATES_INSTALLING || + (s.state == PICO4_UPDATES_DOWNLOADING && s.total <= 0); +} + struct State { enum pico4_settings_page page = PICO4_SETTINGS_LENSES; @@ -176,8 +191,17 @@ start_step(Updates &u, const char *step) { const std::string unit = std::string("overpressure-update@") + step + ".service"; const char *const argv[] = {"systemctl", "start", "--no-block", unit.c_str(), nullptr}; - u.message = u.starter.start(argv, false) ? nullptr : "updates_start_failed"; - u.next = 0; // its first status, now + if (!u.starter.start(argv, false)) { + u.message = "updates_start_failed"; + return; + } + // The step shows at once; the updater's own status takes over as soon as it writes one. + u.message = nullptr; + u.started = (long long)time(nullptr); + u.status.state = pico4_updates_starting(step); + u.status.part[0] = '\0'; + u.status.done = u.status.total = 0; + u.next = 0; } std::string @@ -421,6 +445,16 @@ updates_button(const struct pico4_updates &u, const char *action) return strcmp(action, "download") == 0 ? "updates_download" : strcmp(action, "install") == 0 ? "updates_install" : "updates_check"; } +//! The text key naming a download's part (the updater's status), NULL for one this page does not know. +const char * +updates_part(const char *part) +{ + return strcmp(part, "update") == 0 ? "updates_part_update" + : strcmp(part, "kernel") == 0 ? "updates_part_kernel" + : strcmp(part, "packages") == 0 ? "updates_part_packages" + : nullptr; +} + //! The updates' page, in the page's pixels from its margin. void draw_updates(cairo_t *c, const Updates &u, const Texts &t) @@ -461,26 +495,44 @@ draw_updates(cairo_t *c, const Updates &u, const Texts &t) if (!head.empty()) { y += pico4_text::draw(c, head, 0, y, w, 30, true) + 24; } - if (s.state == PICO4_UPDATES_DOWNLOADING) { - // The bar, its bytes, and that it goes on without the dashboard. + if (s.state == PICO4_UPDATES_DOWNLOADING || updates_moving(s)) { + // The bar: how much of the part is there, or, while that cannot be measured, a segment moving along it. rounded(c, 0, y, w, 16, 8); cairo_set_source_rgb(c, 0.30, 0.33, 0.37); cairo_fill(c); - const double done = pico4_updates_fraction(&s); - if (done > 0) { - rounded(c, 0, y, w * done > 16 ? w * done : 16, 16, 8); - cairo_set_source_rgb(c, 0.27, 0.56, 0.90); + cairo_set_source_rgb(c, 0.27, 0.56, 0.90); + if (updates_moving(s)) { + const double segment = w / 4, along = fmod(now_s() / 1.5, 1.0) * (w + segment) - segment; + cairo_save(c); + cairo_rectangle(c, 0, y, w, 16); + cairo_clip(c); + rounded(c, along, y, segment, 16, 8); cairo_fill(c); + cairo_restore(c); + } else { + const double done = pico4_updates_fraction(&s); + if (done > 0) { + rounded(c, 0, y, w * done > 16 ? w * done : 16, 16, 8); + cairo_fill(c); + } } y += 34; - if (s.total > 0) { - char bytes[64]; - snprintf(bytes, sizeof(bytes), "%lld / %lld MB", s.done >> 20, s.total >> 20); - colour(c, kDim); - y += pico4_text::draw(c, bytes, 0, y, w, 22, false) + 20; + if (s.state == PICO4_UPDATES_DOWNLOADING) { + // What it fetches now, with its bytes once their number is known, and that it goes on without the dashboard. + const char *part = updates_part(s.part); + std::string line = part != nullptr ? t.our(part) : ""; + if (s.total > 0) { + char bytes[48]; + pico4_updates_bytes(s.done, s.total, bytes, sizeof(bytes)); + line += (line.empty() ? "" : ": ") + std::string(bytes); + } + if (!line.empty()) { + colour(c, kDim); + y += pico4_text::draw(c, line, 0, y, w, 22, false) + 20; + } + colour(c, kText); + pico4_text::draw(c, t.our("updates_background"), 0, y, w, 22, false); } - colour(c, kText); - pico4_text::draw(c, t.our("updates_background"), 0, y, w, 22, false); } else if (!body.empty()) { // A release's notes may run long: they stop above the button. cairo_save(c); @@ -738,7 +790,19 @@ render(const char *dir, const char *language) "signed update without a computer\n- Lens distance presets keep their place"); draw_tab(tab, s, t); save(tab, "settings-updates-available"); + u.state = PICO4_UPDATES_CHECKING; + draw_tab(tab, s, t); + save(tab, "settings-updates-checking"); u.state = PICO4_UPDATES_DOWNLOADING; + put(u.part, "kernel"); + u.done = 154492; + u.total = 154492; + draw_tab(tab, s, t); + save(tab, "settings-updates-downloading-kernel"); + put(u.part, "packages"); + u.done = u.total = 0; + draw_tab(tab, s, t); + save(tab, "settings-updates-downloading-unknown"); u.done = 1200ll << 20; u.total = 2900ll << 20; draw_tab(tab, s, t); @@ -1024,6 +1088,7 @@ main(int argc, char **argv) if (u.starter.poll()) { if (u.starter.status != 0) { u.message = "updates_start_failed"; + u.started = 0; // the status as it is, again } u.next = 0; tab_dirty = true; @@ -1035,12 +1100,20 @@ main(int argc, char **argv) } if (u.reader.poll()) { struct pico4_updates latest; + const long long wall = (long long)time(nullptr); if (u.reader.status == 0 && pico4_updates_parse(u.reader.out.c_str(), &latest) && - memcmp(&latest, &u.status, sizeof(latest)) != 0) { - u.status = latest; - tab_dirty = true; + pico4_updates_take(&latest, u.started, wall, kStepHold)) { + u.started = 0; + if (memcmp(&latest, &u.status, sizeof(latest)) != 0) { + u.status = latest; + tab_dirty = true; + } } } + if (visible && s.page == PICO4_SETTINGS_UPDATES && updates_moving(u.status) && now - u.animated >= kAnimation) { + u.animated = now; + tab_dirty = true; + } // Once before anyone looks, so that the tab never opens blank. if (tab_dirty && (visible || !drawn)) { diff --git a/phoenix/pico4-monado/pico4-onboarding.strings b/phoenix/pico4-monado/pico4-onboarding.strings index 408f688..a1c0256 100644 --- a/phoenix/pico4-monado/pico4-onboarding.strings +++ b/phoenix/pico4-monado/pico4-onboarding.strings @@ -61,6 +61,9 @@ updates_installing = Restarting into overpressure recovery… updates_failed = That did not work: %s updates_retry = Try again updates_start_failed = The updater could not be started. +updates_part_update = The release +updates_part_kernel = The kernel +updates_part_packages = The system's packages [german] setup_welcome = Richten wir deine PICO 4 ein: Sprache, Zeitzone, WLAN, Controller und Linsen. @@ -118,6 +121,9 @@ updates_installing = Neustart in die overpressure recovery … updates_failed = Das hat nicht geklappt: %s updates_retry = Erneut versuchen updates_start_failed = Die Aktualisierung konnte nicht gestartet werden. +updates_part_update = Die Version +updates_part_kernel = Der Kernel +updates_part_packages = Die Pakete des Systems [french] setup_welcome = Configurons votre PICO 4 : langue, fuseau horaire, Wi-Fi, manettes et lentilles. @@ -175,6 +181,9 @@ updates_installing = Redémarrage dans overpressure recovery… updates_failed = Cela n'a pas fonctionné : %s updates_retry = Réessayer updates_start_failed = La mise à jour n'a pas pu être lancée. +updates_part_update = La version +updates_part_kernel = Le noyau +updates_part_packages = Les paquets du système [spanish] setup_welcome = Vamos a configurar tus PICO 4: idioma, zona horaria, wifi, mandos y lentes. @@ -232,6 +241,9 @@ updates_installing = Reiniciando en overpressure recovery… updates_failed = No ha funcionado: %s updates_retry = Reintentar updates_start_failed = No se pudo iniciar el actualizador. +updates_part_update = La versión +updates_part_kernel = El kernel +updates_part_packages = Los paquetes del sistema [latam] setup_welcome = Configuremos tus PICO 4: idioma, zona horaria, wifi, controles y lentes. @@ -289,6 +301,9 @@ updates_installing = Reiniciando en overpressure recovery… updates_failed = No funcionó: %s updates_retry = Reintentar updates_start_failed = No se pudo iniciar el actualizador. +updates_part_update = La versión +updates_part_kernel = El kernel +updates_part_packages = Los paquetes del sistema [italian] setup_welcome = Configuriamo il tuo PICO 4: lingua, fuso orario, Wi-Fi, controller e lenti. @@ -346,6 +361,9 @@ updates_installing = Riavvio in overpressure recovery… updates_failed = Non ha funzionato: %s updates_retry = Riprova updates_start_failed = Impossibile avviare l'aggiornamento. +updates_part_update = La versione +updates_part_kernel = Il kernel +updates_part_packages = I pacchetti del sistema [brazilian] setup_welcome = Vamos configurar seu PICO 4: idioma, fuso horário, Wi-Fi, controles e lentes. @@ -403,6 +421,9 @@ updates_installing = Reiniciando no overpressure recovery… updates_failed = Não deu certo: %s updates_retry = Tentar novamente updates_start_failed = Não foi possível iniciar o atualizador. +updates_part_update = A versão +updates_part_kernel = O kernel +updates_part_packages = Os pacotes do sistema [portuguese] setup_welcome = Vamos configurar os seus PICO 4: idioma, fuso horário, Wi-Fi, comandos e lentes. @@ -460,6 +481,9 @@ updates_installing = A reiniciar no overpressure recovery… updates_failed = Não funcionou: %s updates_retry = Tentar novamente updates_start_failed = Não foi possível iniciar o atualizador. +updates_part_update = A versão +updates_part_kernel = O kernel +updates_part_packages = Os pacotes do sistema [dutch] setup_welcome = Laten we je PICO 4 instellen: taal, tijdzone, wifi, controllers en lenzen. @@ -517,6 +541,9 @@ updates_installing = Herstarten in overpressure recovery… updates_failed = Dat is niet gelukt: %s updates_retry = Opnieuw proberen updates_start_failed = De updater kon niet worden gestart. +updates_part_update = De versie +updates_part_kernel = De kernel +updates_part_packages = De pakketten van het systeem [danish] setup_welcome = Lad os konfigurere dit PICO 4: sprog, tidszone, wi-fi, controllere og linser. @@ -574,6 +601,9 @@ updates_installing = Genstarter i overpressure recovery … updates_failed = Det lykkedes ikke: %s updates_retry = Prøv igen updates_start_failed = Opdateringen kunne ikke startes. +updates_part_update = Versionen +updates_part_kernel = Kernen +updates_part_packages = Systemets pakker [swedish] setup_welcome = Nu konfigurerar vi ditt PICO 4: språk, tidszon, wifi, handkontroller och linser. @@ -631,6 +661,9 @@ updates_installing = Startar om i overpressure recovery … updates_failed = Det fungerade inte: %s updates_retry = Försök igen updates_start_failed = Uppdateringen kunde inte startas. +updates_part_update = Versionen +updates_part_kernel = Kärnan +updates_part_packages = Systemets paket [norwegian] setup_welcome = La oss sette opp PICO 4: språk, tidssone, wifi, kontrollere og linser. @@ -688,6 +721,9 @@ updates_installing = Starter på nytt i overpressure recovery … updates_failed = Det fungerte ikke: %s updates_retry = Prøv igjen updates_start_failed = Oppdateringen kunne ikke startes. +updates_part_update = Versjonen +updates_part_kernel = Kjernen +updates_part_packages = Systemets pakker [finnish] setup_welcome = Otetaan PICO 4 käyttöön: kieli, aikavyöhyke, Wi-Fi, ohjaimet ja linssit. @@ -745,6 +781,9 @@ updates_installing = Käynnistetään uudelleen overpressure recoveryyn… updates_failed = Se ei onnistunut: %s updates_retry = Yritä uudelleen updates_start_failed = Päivitystä ei voitu käynnistää. +updates_part_update = Versio +updates_part_kernel = Ydin +updates_part_packages = Järjestelmän paketit [polish] setup_welcome = Skonfigurujmy PICO 4: język, strefę czasową, Wi-Fi, kontrolery i soczewki. @@ -802,6 +841,9 @@ updates_installing = Ponowne uruchamianie w overpressure recovery… updates_failed = Nie udało się: %s updates_retry = Spróbuj ponownie updates_start_failed = Nie udało się uruchomić aktualizacji. +updates_part_update = Wersja +updates_part_kernel = Jądro +updates_part_packages = Pakiety systemu [czech] setup_welcome = Pojďme nastavit vaše PICO 4: jazyk, časové pásmo, Wi-Fi, ovladače a čočky. @@ -859,6 +901,9 @@ updates_installing = Restart do overpressure recovery… updates_failed = Nepodařilo se: %s updates_retry = Zkusit znovu updates_start_failed = Aktualizaci se nepodařilo spustit. +updates_part_update = Verze +updates_part_kernel = Jádro +updates_part_packages = Balíčky systému [hungarian] setup_welcome = Állítsuk be a PICO 4-et: nyelv, időzóna, Wi-Fi, kontrollerek és lencsék. @@ -916,6 +961,9 @@ updates_installing = Újraindítás az overpressure recoverybe… updates_failed = Nem sikerült: %s updates_retry = Újra updates_start_failed = A frissítőt nem sikerült elindítani. +updates_part_update = A kiadás +updates_part_kernel = A kernel +updates_part_packages = A rendszer csomagjai [romanian] setup_welcome = Să configurăm ochelarii PICO 4: limba, fusul orar, Wi-Fi, controlerele și lentilele. @@ -973,6 +1021,9 @@ updates_installing = Se repornește în overpressure recovery… updates_failed = Nu a funcționat: %s updates_retry = Încearcă din nou updates_start_failed = Actualizarea nu a putut fi pornită. +updates_part_update = Versiunea +updates_part_kernel = Nucleul +updates_part_packages = Pachetele sistemului [bulgarian] setup_welcome = Нека настроим PICO 4: език, часова зона, Wi-Fi, контролери и лещи. @@ -1030,6 +1081,9 @@ updates_installing = Рестартиране в overpressure recovery… updates_failed = Не се получи: %s updates_retry = Опитай отново updates_start_failed = Актуализацията не можа да се стартира. +updates_part_update = Версията +updates_part_kernel = Ядрото +updates_part_packages = Пакетите на системата [russian] setup_welcome = Давайте настроим PICO 4: язык, часовой пояс, Wi-Fi, контроллеры и линзы. @@ -1087,6 +1141,9 @@ updates_installing = Перезапуск в overpressure recovery… updates_failed = Не получилось: %s updates_retry = Повторить updates_start_failed = Не удалось запустить обновление. +updates_part_update = Версия +updates_part_kernel = Ядро +updates_part_packages = Пакеты системы [ukrainian] setup_welcome = Налаштуймо PICO 4: мову, часовий пояс, Wi-Fi, контролери та лінзи. @@ -1144,6 +1201,9 @@ updates_installing = Перезапуск в overpressure recovery… updates_failed = Не вдалося: %s updates_retry = Спробувати ще раз updates_start_failed = Не вдалося запустити оновлення. +updates_part_update = Версія +updates_part_kernel = Ядро +updates_part_packages = Пакети системи [greek] setup_welcome = Ας ρυθμίσουμε το PICO 4: γλώσσα, ζώνη ώρας, Wi-Fi, χειριστήρια και φακούς. @@ -1201,6 +1261,9 @@ updates_installing = Επανεκκίνηση στο overpressure recovery… updates_failed = Δεν λειτούργησε: %s updates_retry = Δοκίμασε ξανά updates_start_failed = Η ενημέρωση δεν μπόρεσε να ξεκινήσει. +updates_part_update = Η έκδοση +updates_part_kernel = Ο πυρήνας +updates_part_packages = Τα πακέτα του συστήματος [turkish] setup_welcome = PICO 4'ünüzü kuralım: dil, saat dilimi, Wi-Fi, kumandalar ve lensler. @@ -1258,6 +1321,9 @@ updates_installing = overpressure recovery ile yeniden başlatılıyor… updates_failed = Olmadı: %s updates_retry = Yeniden dene updates_start_failed = Güncelleyici başlatılamadı. +updates_part_update = Sürüm +updates_part_kernel = Çekirdek +updates_part_packages = Sistemin paketleri [arabic] setup_welcome = لنُعدّ نظارة PICO 4: اللغة والمنطقة الزمنية وشبكة Wi-Fi ووحدات التحكم والعدسات. @@ -1315,6 +1381,9 @@ updates_installing = جارٍ إعادة التشغيل في overpressure recove updates_failed = لم ينجح ذلك: %s updates_retry = إعادة المحاولة updates_start_failed = تعذّر بدء أداة التحديث. +updates_part_update = الإصدار +updates_part_kernel = النواة +updates_part_packages = حزم النظام [japanese] setup_welcome = PICO 4 をセットアップしましょう:言語、タイムゾーン、Wi-Fi、コントローラー、レンズ。 @@ -1372,6 +1441,9 @@ updates_installing = overpressure recovery で再起動しています… updates_failed = うまくいきませんでした: %s updates_retry = 再試行 updates_start_failed = アップデーターを開始できませんでした。 +updates_part_update = リリース +updates_part_kernel = カーネル +updates_part_packages = システムのパッケージ [koreana] setup_welcome = PICO 4를 설정해 보겠습니다: 언어, 시간대, Wi-Fi, 컨트롤러, 렌즈. @@ -1429,6 +1501,9 @@ updates_installing = overpressure recovery로 다시 시작하는 중… updates_failed = 실패했습니다: %s updates_retry = 다시 시도 updates_start_failed = 업데이트 프로그램을 시작할 수 없습니다. +updates_part_update = 릴리스 +updates_part_kernel = 커널 +updates_part_packages = 시스템 패키지 [schinese] setup_welcome = 让我们来设置 PICO 4:语言、时区、Wi-Fi、手柄和镜片。 @@ -1486,6 +1561,9 @@ updates_installing = 正在重启进入 overpressure recovery… updates_failed = 未成功:%s updates_retry = 重试 updates_start_failed = 无法启动更新程序。 +updates_part_update = 版本 +updates_part_kernel = 内核 +updates_part_packages = 系统软件包 [tchinese] setup_welcome = 讓我們設定 PICO 4:語言、時區、Wi-Fi、控制器和鏡片。 @@ -1543,6 +1621,9 @@ updates_installing = 正在重新啟動進入 overpressure recovery… updates_failed = 未成功:%s updates_retry = 重試 updates_start_failed = 無法啟動更新程式。 +updates_part_update = 版本 +updates_part_kernel = 核心 +updates_part_packages = 系統套件 [thai] setup_welcome = มาตั้งค่า PICO 4 กัน: ภาษา เขตเวลา Wi-Fi คอนโทรลเลอร์ และเลนส์ @@ -1600,6 +1681,9 @@ updates_installing = กำลังรีสตาร์ทเข้าสู updates_failed = ไม่สำเร็จ: %s updates_retry = ลองอีกครั้ง updates_start_failed = ไม่สามารถเริ่มตัวอัปเดตได้ +updates_part_update = รุ่น +updates_part_kernel = เคอร์เนล +updates_part_packages = แพ็กเกจของระบบ [vietnamese] setup_welcome = Hãy thiết lập PICO 4: ngôn ngữ, múi giờ, Wi-Fi, tay cầm và thấu kính. @@ -1657,6 +1741,9 @@ updates_installing = Đang khởi động lại vào overpressure recovery… updates_failed = Không thành công: %s updates_retry = Thử lại updates_start_failed = Không thể khởi động trình cập nhật. +updates_part_update = Phiên bản +updates_part_kernel = Nhân hệ thống +updates_part_packages = Các gói của hệ thống [indonesian] setup_welcome = Mari siapkan PICO 4 Anda: bahasa, zona waktu, Wi-Fi, kontroler, dan lensa. @@ -1714,6 +1801,9 @@ updates_installing = Memulai ulang ke overpressure recovery… updates_failed = Tidak berhasil: %s updates_retry = Coba lagi updates_start_failed = Pembaru tidak dapat dimulai. +updates_part_update = Rilis +updates_part_kernel = Kernel +updates_part_packages = Paket sistem [malay] setup_welcome = Mari sediakan PICO 4 anda: bahasa, zon waktu, Wi-Fi, pengawal dan kanta. @@ -1771,3 +1861,6 @@ updates_installing = Memulakan semula ke overpressure recovery… updates_failed = Tidak berjaya: %s updates_retry = Cuba lagi updates_start_failed = Pengemas kini tidak dapat dimulakan. +updates_part_update = Keluaran +updates_part_kernel = Kernel +updates_part_packages = Pakej sistem diff --git a/phoenix/pico4-monado/pico4_settings.h b/phoenix/pico4-monado/pico4_settings.h index 18e9965..c65dfaf 100644 --- a/phoenix/pico4-monado/pico4_settings.h +++ b/phoenix/pico4-monado/pico4_settings.h @@ -129,7 +129,9 @@ struct pico4_updates enum pico4_updates_state state; bool current; //!< idle after a check that found nothing newer char installed[48], version[48], title[128], notes[640], reason[256], step[16]; - long long done, total; //!< a download's bytes + char part[16]; //!< what a download fetches now: update, kernel or packages + long long done, total; //!< its bytes; total 0 while its size is not known yet + long long time; //!< when the updater wrote it, in seconds since 1970 }; // The page, in the page's pixels from its 30 px margin: the text from the top, a download's bar, @@ -286,6 +288,10 @@ pico4_updates_parse(const char *json, struct pico4_updates *u) if (pico4_json_field(json, "total", number, sizeof(number))) { u->total = atoll(number); } + if (pico4_json_field(json, "time", number, sizeof(number))) { + u->time = atoll(number); + } + pico4_json_field(json, "part", u->part, sizeof(u->part)); return true; } @@ -317,6 +323,40 @@ pico4_updates_fraction(const struct pico4_updates *u) return f < 0 ? 0 : f > 1 ? 1 : f; } +//! A download's bytes as "DONE / TOTAL UNIT" in @p out, in the unit that suits TOTAL (KB, MB, GB). +static inline void +pico4_updates_bytes(long long done, long long total, char *out, size_t size) +{ + if (total >= 1ll << 30) { + snprintf(out, size, "%.1f / %.1f GB", done / 1073741824.0, total / 1073741824.0); + } else if (total >= 1ll << 20) { + snprintf(out, size, "%lld / %lld MB", done >> 20, total >> 20); + } else { + snprintf(out, size, "%lld / %lld KB", (done + 1023) >> 10, (total + 1023) >> 10); + } +} + +//! The state a step @p action shows from the moment its button is let go, before the updater says so itself. +static inline enum pico4_updates_state +pico4_updates_starting(const char *action) +{ + return strcmp(action, "download") == 0 ? PICO4_UPDATES_DOWNLOADING + : strcmp(action, "install") == 0 ? PICO4_UPDATES_INSTALLING + : PICO4_UPDATES_CHECKING; +} + +/*! + * Whether the page takes the status @p read, written at its time, after a step's button was let go + * at @p pressed (seconds since 1970; 0: none): a status from before the press only once @p hold + * seconds have passed since it, so the step shows at once and a step that never started shows the + * old status again. + */ +static inline bool +pico4_updates_take(const struct pico4_updates *read, long long pressed, long long now, long long hold) +{ + return pressed == 0 || read->time >= pressed || now >= pressed + hold; +} + //! Whether (@p x, @p y) of the updates' page is on its button, where it is @p shown. static inline bool pico4_updates_hit(double x, double y, bool shown) diff --git a/phoenix/pico4-monado/test_pico4_settings.c b/phoenix/pico4-monado/test_pico4_settings.c index 8c943f2..4e97c21 100644 --- a/phoenix/pico4-monado/test_pico4_settings.c +++ b/phoenix/pico4-monado/test_pico4_settings.c @@ -72,6 +72,27 @@ main(void) EXPECT(u.state == PICO4_UPDATES_DOWNLOADING && u.done == 1048576 && u.total == 4194304); EXPECT(pico4_updates_fraction(&u) == 0.25); EXPECT(pico4_updates_action(&u) == NULL); + EXPECT(strcmp(u.part, "packages") == 0); + // Its bytes in the unit that suits the part: a small file is no "0 / 0 MB". + char bytes[48]; + pico4_updates_bytes(154492, 154492, bytes, sizeof(bytes)); + EXPECT(strcmp(bytes, "151 / 151 KB") == 0); + pico4_updates_bytes(12ll << 20, 28860316, bytes, sizeof(bytes)); + EXPECT(strcmp(bytes, "12 / 27 MB") == 0); + pico4_updates_bytes(1288490188ll, 3152019456ll, bytes, sizeof(bytes)); + EXPECT(strcmp(bytes, "1.2 / 2.9 GB") == 0); + // A step shows from the moment its button is let go; the status from before the press waits until the + // updater writes a newer one, or the hold is over (a step that never started). + EXPECT(pico4_updates_starting("check") == PICO4_UPDATES_CHECKING); + EXPECT(pico4_updates_starting("download") == PICO4_UPDATES_DOWNLOADING); + EXPECT(pico4_updates_starting("install") == PICO4_UPDATES_INSTALLING); + struct pico4_updates old = {.state = PICO4_UPDATES_IDLE, .time = 1000}; + EXPECT(!pico4_updates_take(&old, 1005, 1006, 10)); + EXPECT(pico4_updates_take(&old, 1005, 1015, 10)); + EXPECT(pico4_updates_take(&old, 0, 1006, 10)); + struct pico4_updates newer = {.state = PICO4_UPDATES_CHECKING, .time = 1005}; + EXPECT(pico4_updates_take(&newer, 1005, 1006, 10)); + EXPECT(pico4_updates_parse("{\"state\": \"idle\", \"time\": 1796215710}", &u) && u.time == 1796215710); // Idle after a check: Check again; ready: Restart and install; installing: nothing. EXPECT(pico4_updates_parse("{\"current\": true, \"installed\": \"2026.12.0b2\", \"state\": \"idle\"}", &u)); EXPECT(u.current && strcmp(pico4_updates_action(&u), "check") == 0); From 8c09257c360454729c0e3d97bfead3259bb27a52 Mon Sep 17 00:00:00 2001 From: Xenolphthalein <21215869+Xenolphthalein@users.noreply.github.com> Date: Wed, 2 Dec 2026 14:12:40 +0100 Subject: [PATCH 5/9] fix(pico4-monado): the Updates page says an update installs in about 10 minutes, as measured --- phoenix/pico4-monado/PKGBUILD | 2 +- phoenix/pico4-monado/pico4-onboarding.strings | 62 +++++++++---------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/phoenix/pico4-monado/PKGBUILD b/phoenix/pico4-monado/PKGBUILD index 1dff7f0..97f9f84 100644 --- a/phoenix/pico4-monado/PKGBUILD +++ b/phoenix/pico4-monado/PKGBUILD @@ -104,7 +104,7 @@ sha256sums=(SKIP 'fedc001568c106e488b26f2fd4418dd563351089c76af4d05c328d3cd1cf5c51' '4104d15d75e3dff32b8edf5779b9a73cacd85e5a36d6bd1a8c23f928889a3cc6' 'c282f2979f0785017a988bd439b928a733625b27417d3024e1d28f66531c91f1' - '19afb4c2e2d499dad81ac3cf4b186f3f5fdf931f9e8faf92d0211cf5dc4b31ae' + 'b66dc9d2a28e245a6ebe7ed546e32a172e963f709bb4afe72c4bf815adce2b64' 'cc727edbad724f50656255313d81ebc56dc6c168bbe05f10f8c57cfecd3829a4' '1e216b8317b7dcbdefb623a59dedf67ab580ffcfcd5b671a5420e777ce88aea9' '58f7dba6fbdb8473b6efffd4a31ce4ce32fd485d499355802ca850923e0bcfd6' diff --git a/phoenix/pico4-monado/pico4-onboarding.strings b/phoenix/pico4-monado/pico4-onboarding.strings index a1c0256..e492079 100644 --- a/phoenix/pico4-monado/pico4-onboarding.strings +++ b/phoenix/pico4-monado/pico4-onboarding.strings @@ -55,7 +55,7 @@ updates_download = Download updates_downloading = Downloading %s updates_background = The download goes on when you close the dashboard. updates_ready = %s is ready to install. -updates_ready_how = The headset restarts into overpressure recovery, which installs the update in about 20 minutes. Your games and data stay. It needs 40 % battery or the cable. +updates_ready_how = The headset restarts into overpressure recovery, which installs the update in about 10 minutes. Your games and data stay. It needs 40 % battery or the cable. updates_install = Restart and install updates_installing = Restarting into overpressure recovery… updates_failed = That did not work: %s @@ -115,7 +115,7 @@ updates_download = Herunterladen updates_downloading = %s wird heruntergeladen updates_background = Der Download läuft weiter, wenn du das Dashboard schließt. updates_ready = %s ist bereit zur Installation. -updates_ready_how = Das Headset startet in die overpressure recovery neu, die das Update in etwa 20 Minuten installiert. Deine Spiele und Daten bleiben erhalten. Es braucht 40 % Akku oder das Kabel. +updates_ready_how = Das Headset startet in die overpressure recovery neu, die das Update in etwa 10 Minuten installiert. Deine Spiele und Daten bleiben erhalten. Es braucht 40 % Akku oder das Kabel. updates_install = Neu starten und installieren updates_installing = Neustart in die overpressure recovery … updates_failed = Das hat nicht geklappt: %s @@ -175,7 +175,7 @@ updates_download = Télécharger updates_downloading = Téléchargement de %s updates_background = Le téléchargement continue lorsque vous fermez le tableau de bord. updates_ready = %s est prête à être installée. -updates_ready_how = Le casque redémarre dans overpressure recovery, qui installe la mise à jour en 20 minutes environ. Vos jeux et vos données sont conservés. Il faut 40 % de batterie ou le câble. +updates_ready_how = Le casque redémarre dans overpressure recovery, qui installe la mise à jour en 10 minutes environ. Vos jeux et vos données sont conservés. Il faut 40 % de batterie ou le câble. updates_install = Redémarrer et installer updates_installing = Redémarrage dans overpressure recovery… updates_failed = Cela n'a pas fonctionné : %s @@ -235,7 +235,7 @@ updates_download = Descargar updates_downloading = Descargando %s updates_background = La descarga continúa cuando cierras el panel. updates_ready = %s está lista para instalarse. -updates_ready_how = El visor se reinicia en overpressure recovery, que instala la actualización en unos 20 minutos. Tus juegos y datos se conservan. Necesita un 40 % de batería o el cable. +updates_ready_how = El visor se reinicia en overpressure recovery, que instala la actualización en unos 10 minutos. Tus juegos y datos se conservan. Necesita un 40 % de batería o el cable. updates_install = Reiniciar e instalar updates_installing = Reiniciando en overpressure recovery… updates_failed = No ha funcionado: %s @@ -295,7 +295,7 @@ updates_download = Descargar updates_downloading = Descargando %s updates_background = La descarga continúa cuando cierras el panel. updates_ready = %s está lista para instalarse. -updates_ready_how = El visor se reinicia en overpressure recovery, que instala la actualización en unos 20 minutos. Tus juegos y datos se conservan. Necesita 40 % de batería o el cable. +updates_ready_how = El visor se reinicia en overpressure recovery, que instala la actualización en unos 10 minutos. Tus juegos y datos se conservan. Necesita 40 % de batería o el cable. updates_install = Reiniciar e instalar updates_installing = Reiniciando en overpressure recovery… updates_failed = No funcionó: %s @@ -355,7 +355,7 @@ updates_download = Scarica updates_downloading = Download di %s updates_background = Il download prosegue quando chiudi la dashboard. updates_ready = %s è pronta per l'installazione. -updates_ready_how = Il visore si riavvia in overpressure recovery, che installa l'aggiornamento in circa 20 minuti. Giochi e dati restano. Servono il 40 % di batteria o il cavo. +updates_ready_how = Il visore si riavvia in overpressure recovery, che installa l'aggiornamento in circa 10 minuti. Giochi e dati restano. Servono il 40 % di batteria o il cavo. updates_install = Riavvia e installa updates_installing = Riavvio in overpressure recovery… updates_failed = Non ha funzionato: %s @@ -415,7 +415,7 @@ updates_download = Baixar updates_downloading = Baixando %s updates_background = O download continua quando você fecha o painel. updates_ready = %s está pronta para instalar. -updates_ready_how = O headset reinicia no overpressure recovery, que instala a atualização em cerca de 20 minutos. Seus jogos e dados são mantidos. É preciso 40 % de bateria ou o cabo. +updates_ready_how = O headset reinicia no overpressure recovery, que instala a atualização em cerca de 10 minutos. Seus jogos e dados são mantidos. É preciso 40 % de bateria ou o cabo. updates_install = Reiniciar e instalar updates_installing = Reiniciando no overpressure recovery… updates_failed = Não deu certo: %s @@ -475,7 +475,7 @@ updates_download = Transferir updates_downloading = A transferir %s updates_background = A transferência continua quando fecha o painel. updates_ready = %s está pronta para ser instalada. -updates_ready_how = O headset reinicia no overpressure recovery, que instala a atualização em cerca de 20 minutos. Os seus jogos e dados mantêm-se. São precisos 40 % de bateria ou o cabo. +updates_ready_how = O headset reinicia no overpressure recovery, que instala a atualização em cerca de 10 minutos. Os seus jogos e dados mantêm-se. São precisos 40 % de bateria ou o cabo. updates_install = Reiniciar e instalar updates_installing = A reiniciar no overpressure recovery… updates_failed = Não funcionou: %s @@ -535,7 +535,7 @@ updates_download = Downloaden updates_downloading = %s wordt gedownload updates_background = Het downloaden gaat door als je het dashboard sluit. updates_ready = %s is klaar om te installeren. -updates_ready_how = De headset start opnieuw op in overpressure recovery, die de update in ongeveer 20 minuten installeert. Je games en gegevens blijven behouden. Er is 40 % batterij of de kabel nodig. +updates_ready_how = De headset start opnieuw op in overpressure recovery, die de update in ongeveer 10 minuten installeert. Je games en gegevens blijven behouden. Er is 40 % batterij of de kabel nodig. updates_install = Herstarten en installeren updates_installing = Herstarten in overpressure recovery… updates_failed = Dat is niet gelukt: %s @@ -595,7 +595,7 @@ updates_download = Download updates_downloading = Downloader %s updates_background = Downloaden fortsætter, når du lukker dashboardet. updates_ready = %s er klar til installation. -updates_ready_how = Headsettet genstarter i overpressure recovery, som installerer opdateringen på cirka 20 minutter. Dine spil og data bevares. Det kræver 40 % batteri eller kablet. +updates_ready_how = Headsettet genstarter i overpressure recovery, som installerer opdateringen på cirka 10 minutter. Dine spil og data bevares. Det kræver 40 % batteri eller kablet. updates_install = Genstart og installer updates_installing = Genstarter i overpressure recovery … updates_failed = Det lykkedes ikke: %s @@ -655,7 +655,7 @@ updates_download = Ladda ned updates_downloading = Laddar ned %s updates_background = Nedladdningen fortsätter när du stänger instrumentpanelen. updates_ready = %s är redo att installeras. -updates_ready_how = Headsetet startar om i overpressure recovery, som installerar uppdateringen på ungefär 20 minuter. Dina spel och data finns kvar. Det behövs 40 % batteri eller kabeln. +updates_ready_how = Headsetet startar om i overpressure recovery, som installerar uppdateringen på ungefär 10 minuter. Dina spel och data finns kvar. Det behövs 40 % batteri eller kabeln. updates_install = Starta om och installera updates_installing = Startar om i overpressure recovery … updates_failed = Det fungerade inte: %s @@ -715,7 +715,7 @@ updates_download = Last ned updates_downloading = Laster ned %s updates_background = Nedlastingen fortsetter når du lukker dashbordet. updates_ready = %s er klar til å installeres. -updates_ready_how = Hodesettet starter på nytt i overpressure recovery, som installerer oppdateringen på omtrent 20 minutter. Spillene og dataene dine beholdes. Det trengs 40 % batteri eller kabelen. +updates_ready_how = Hodesettet starter på nytt i overpressure recovery, som installerer oppdateringen på omtrent 10 minutter. Spillene og dataene dine beholdes. Det trengs 40 % batteri eller kabelen. updates_install = Start på nytt og installer updates_installing = Starter på nytt i overpressure recovery … updates_failed = Det fungerte ikke: %s @@ -775,7 +775,7 @@ updates_download = Lataa updates_downloading = Ladataan: %s updates_background = Lataus jatkuu, kun suljet hallintapaneelin. updates_ready = %s on valmis asennettavaksi. -updates_ready_how = Lasit käynnistyvät uudelleen overpressure recoveryyn, joka asentaa päivityksen noin 20 minuutissa. Pelisi ja tietosi säilyvät. Akkua tarvitaan 40 % tai kaapeli. +updates_ready_how = Lasit käynnistyvät uudelleen overpressure recoveryyn, joka asentaa päivityksen noin 10 minuutissa. Pelisi ja tietosi säilyvät. Akkua tarvitaan 40 % tai kaapeli. updates_install = Käynnistä uudelleen ja asenna updates_installing = Käynnistetään uudelleen overpressure recoveryyn… updates_failed = Se ei onnistunut: %s @@ -835,7 +835,7 @@ updates_download = Pobierz updates_downloading = Pobieranie: %s updates_background = Pobieranie trwa dalej po zamknięciu panelu. updates_ready = Wersja %s jest gotowa do instalacji. -updates_ready_how = Gogle uruchomią się ponownie w overpressure recovery, które zainstaluje aktualizację w około 20 minut. Gry i dane zostają. Potrzeba 40 % baterii lub kabla. +updates_ready_how = Gogle uruchomią się ponownie w overpressure recovery, które zainstaluje aktualizację w około 10 minut. Gry i dane zostają. Potrzeba 40 % baterii lub kabla. updates_install = Uruchom ponownie i zainstaluj updates_installing = Ponowne uruchamianie w overpressure recovery… updates_failed = Nie udało się: %s @@ -895,7 +895,7 @@ updates_download = Stáhnout updates_downloading = Stahuje se %s updates_background = Stahování pokračuje i po zavření panelu. updates_ready = %s je připravena k instalaci. -updates_ready_how = Headset se restartuje do overpressure recovery, která aktualizaci nainstaluje asi za 20 minut. Hry a data zůstanou. Potřebuje 40 % baterie nebo kabel. +updates_ready_how = Headset se restartuje do overpressure recovery, která aktualizaci nainstaluje asi za 10 minut. Hry a data zůstanou. Potřebuje 40 % baterie nebo kabel. updates_install = Restartovat a nainstalovat updates_installing = Restart do overpressure recovery… updates_failed = Nepodařilo se: %s @@ -955,7 +955,7 @@ updates_download = Letöltés updates_downloading = Letöltés: %s updates_background = A letöltés folytatódik, ha bezárod a vezérlőpultot. updates_ready = A(z) %s telepítésre kész. -updates_ready_how = A headset újraindul az overpressure recoverybe, amely kb. 20 perc alatt telepíti a frissítést. A játékaid és adataid megmaradnak. 40 % töltöttség vagy a kábel szükséges. +updates_ready_how = A headset újraindul az overpressure recoverybe, amely kb. 10 perc alatt telepíti a frissítést. A játékaid és adataid megmaradnak. 40 % töltöttség vagy a kábel szükséges. updates_install = Újraindítás és telepítés updates_installing = Újraindítás az overpressure recoverybe… updates_failed = Nem sikerült: %s @@ -1015,7 +1015,7 @@ updates_download = Descarcă updates_downloading = Se descarcă %s updates_background = Descărcarea continuă când închizi panoul. updates_ready = %s este gata de instalare. -updates_ready_how = Casca repornește în overpressure recovery, care instalează actualizarea în aproximativ 20 de minute. Jocurile și datele rămân. Are nevoie de 40 % baterie sau de cablu. +updates_ready_how = Casca repornește în overpressure recovery, care instalează actualizarea în aproximativ 10 de minute. Jocurile și datele rămân. Are nevoie de 40 % baterie sau de cablu. updates_install = Repornește și instalează updates_installing = Se repornește în overpressure recovery… updates_failed = Nu a funcționat: %s @@ -1075,7 +1075,7 @@ updates_download = Изтегляне updates_downloading = Изтегляне на %s updates_background = Изтеглянето продължава, когато затвориш таблото. updates_ready = %s е готова за инсталиране. -updates_ready_how = Шлемът се рестартира в overpressure recovery, което инсталира актуализацията за около 20 минути. Игрите и данните ти остават. Нужни са 40 % батерия или кабелът. +updates_ready_how = Шлемът се рестартира в overpressure recovery, което инсталира актуализацията за около 10 минути. Игрите и данните ти остават. Нужни са 40 % батерия или кабелът. updates_install = Рестартиране и инсталиране updates_installing = Рестартиране в overpressure recovery… updates_failed = Не се получи: %s @@ -1135,7 +1135,7 @@ updates_download = Загрузить updates_downloading = Загрузка %s updates_background = Загрузка продолжится, если закрыть панель. updates_ready = %s готова к установке. -updates_ready_how = Гарнитура перезапустится в overpressure recovery, которое установит обновление примерно за 20 минут. Игры и данные сохранятся. Нужно 40 % заряда или кабель. +updates_ready_how = Гарнитура перезапустится в overpressure recovery, которое установит обновление примерно за 10 минут. Игры и данные сохранятся. Нужно 40 % заряда или кабель. updates_install = Перезапустить и установить updates_installing = Перезапуск в overpressure recovery… updates_failed = Не получилось: %s @@ -1195,7 +1195,7 @@ updates_download = Завантажити updates_downloading = Завантаження %s updates_background = Завантаження триває, коли ви закриваєте панель. updates_ready = %s готова до встановлення. -updates_ready_how = Гарнітура перезапуститься в overpressure recovery, яке встановить оновлення приблизно за 20 хвилин. Ігри та дані залишаться. Потрібно 40 % заряду або кабель. +updates_ready_how = Гарнітура перезапуститься в overpressure recovery, яке встановить оновлення приблизно за 10 хвилин. Ігри та дані залишаться. Потрібно 40 % заряду або кабель. updates_install = Перезапустити й встановити updates_installing = Перезапуск в overpressure recovery… updates_failed = Не вдалося: %s @@ -1255,7 +1255,7 @@ updates_download = Λήψη updates_downloading = Λήψη %s updates_background = Η λήψη συνεχίζεται όταν κλείσεις τον πίνακα. updates_ready = Η έκδοση %s είναι έτοιμη για εγκατάσταση. -updates_ready_how = Το headset επανεκκινεί στο overpressure recovery, που εγκαθιστά την ενημέρωση σε περίπου 20 λεπτά. Τα παιχνίδια και τα δεδομένα σου παραμένουν. Χρειάζεται 40 % μπαταρία ή το καλώδιο. +updates_ready_how = Το headset επανεκκινεί στο overpressure recovery, που εγκαθιστά την ενημέρωση σε περίπου 10 λεπτά. Τα παιχνίδια και τα δεδομένα σου παραμένουν. Χρειάζεται 40 % μπαταρία ή το καλώδιο. updates_install = Επανεκκίνηση και εγκατάσταση updates_installing = Επανεκκίνηση στο overpressure recovery… updates_failed = Δεν λειτούργησε: %s @@ -1315,7 +1315,7 @@ updates_download = İndir updates_downloading = %s indiriliyor updates_background = Paneli kapattığında indirme sürer. updates_ready = %s yüklenmeye hazır. -updates_ready_how = Başlık overpressure recovery ile yeniden başlar; güncellemeyi yaklaşık 20 dakikada yükler. Oyunların ve verilerin korunur. %40 pil ya da kablo gerekir. +updates_ready_how = Başlık overpressure recovery ile yeniden başlar; güncellemeyi yaklaşık 10 dakikada yükler. Oyunların ve verilerin korunur. %40 pil ya da kablo gerekir. updates_install = Yeniden başlat ve yükle updates_installing = overpressure recovery ile yeniden başlatılıyor… updates_failed = Olmadı: %s @@ -1375,7 +1375,7 @@ updates_download = تنزيل updates_downloading = جارٍ تنزيل %s updates_background = يستمر التنزيل عند إغلاق لوحة التحكم. updates_ready = %s جاهز للتثبيت. -updates_ready_how = يُعاد تشغيل السماعة في overpressure recovery الذي يثبّت التحديث في نحو 20 دقيقة. تبقى ألعابك وبياناتك. يلزم شحن 40 % أو الكابل. +updates_ready_how = يُعاد تشغيل السماعة في overpressure recovery الذي يثبّت التحديث في نحو 10 دقيقة. تبقى ألعابك وبياناتك. يلزم شحن 40 % أو الكابل. updates_install = إعادة التشغيل والتثبيت updates_installing = جارٍ إعادة التشغيل في overpressure recovery… updates_failed = لم ينجح ذلك: %s @@ -1435,7 +1435,7 @@ updates_download = ダウンロード updates_downloading = %s をダウンロード中 updates_background = ダッシュボードを閉じてもダウンロードは続きます。 updates_ready = %s をインストールする準備ができました。 -updates_ready_how = ヘッドセットが overpressure recovery で再起動し、約 20 分でアップデートをインストールします。ゲームとデータはそのまま残ります。バッテリー残量 40 % 以上かケーブルが必要です。 +updates_ready_how = ヘッドセットが overpressure recovery で再起動し、約 10 分でアップデートをインストールします。ゲームとデータはそのまま残ります。バッテリー残量 40 % 以上かケーブルが必要です。 updates_install = 再起動してインストール updates_installing = overpressure recovery で再起動しています… updates_failed = うまくいきませんでした: %s @@ -1495,7 +1495,7 @@ updates_download = 다운로드 updates_downloading = %s 다운로드 중 updates_background = 대시보드를 닫아도 다운로드가 계속됩니다. updates_ready = %s을(를) 설치할 준비가 되었습니다. -updates_ready_how = 헤드셋이 overpressure recovery로 다시 시작되며, 약 20분 동안 업데이트를 설치합니다. 게임과 데이터는 그대로 유지됩니다. 배터리 40 % 이상 또는 케이블이 필요합니다. +updates_ready_how = 헤드셋이 overpressure recovery로 다시 시작되며, 약 10분 동안 업데이트를 설치합니다. 게임과 데이터는 그대로 유지됩니다. 배터리 40 % 이상 또는 케이블이 필요합니다. updates_install = 다시 시작 및 설치 updates_installing = overpressure recovery로 다시 시작하는 중… updates_failed = 실패했습니다: %s @@ -1555,7 +1555,7 @@ updates_download = 下载 updates_downloading = 正在下载 %s updates_background = 关闭仪表板后下载仍会继续。 updates_ready = %s 已可安装。 -updates_ready_how = 头显会重启进入 overpressure recovery,约 20 分钟内安装更新。你的游戏和数据会保留。需要 40 % 电量或连接线缆。 +updates_ready_how = 头显会重启进入 overpressure recovery,约 10 分钟内安装更新。你的游戏和数据会保留。需要 40 % 电量或连接线缆。 updates_install = 重启并安装 updates_installing = 正在重启进入 overpressure recovery… updates_failed = 未成功:%s @@ -1615,7 +1615,7 @@ updates_download = 下載 updates_downloading = 正在下載 %s updates_background = 關閉控制面板後,下載仍會繼續。 updates_ready = %s 已可安裝。 -updates_ready_how = 頭戴裝置會重新啟動進入 overpressure recovery,約 20 分鐘內安裝更新。你的遊戲與資料會保留。需要 40 % 電量或連接纜線。 +updates_ready_how = 頭戴裝置會重新啟動進入 overpressure recovery,約 10 分鐘內安裝更新。你的遊戲與資料會保留。需要 40 % 電量或連接纜線。 updates_install = 重新啟動並安裝 updates_installing = 正在重新啟動進入 overpressure recovery… updates_failed = 未成功:%s @@ -1675,7 +1675,7 @@ updates_download = ดาวน์โหลด updates_downloading = กำลังดาวน์โหลด %s updates_background = การดาวน์โหลดจะดำเนินต่อเมื่อคุณปิดแดชบอร์ด updates_ready = %s พร้อมติดตั้งแล้ว -updates_ready_how = ชุดหูฟังจะรีสตาร์ทเข้าสู่ overpressure recovery ซึ่งจะติดตั้งอัปเดตในเวลาประมาณ 20 นาที เกมและข้อมูลของคุณจะยังอยู่ ต้องมีแบตเตอรี่ 40 % หรือเสียบสาย +updates_ready_how = ชุดหูฟังจะรีสตาร์ทเข้าสู่ overpressure recovery ซึ่งจะติดตั้งอัปเดตในเวลาประมาณ 10 นาที เกมและข้อมูลของคุณจะยังอยู่ ต้องมีแบตเตอรี่ 40 % หรือเสียบสาย updates_install = รีสตาร์ทและติดตั้ง updates_installing = กำลังรีสตาร์ทเข้าสู่ overpressure recovery… updates_failed = ไม่สำเร็จ: %s @@ -1735,7 +1735,7 @@ updates_download = Tải xuống updates_downloading = Đang tải xuống %s updates_background = Việc tải xuống vẫn tiếp tục khi bạn đóng bảng điều khiển. updates_ready = %s đã sẵn sàng để cài đặt. -updates_ready_how = Kính sẽ khởi động lại vào overpressure recovery để cài đặt bản cập nhật trong khoảng 20 phút. Trò chơi và dữ liệu của bạn được giữ nguyên. Cần 40 % pin hoặc cắm cáp. +updates_ready_how = Kính sẽ khởi động lại vào overpressure recovery để cài đặt bản cập nhật trong khoảng 10 phút. Trò chơi và dữ liệu của bạn được giữ nguyên. Cần 40 % pin hoặc cắm cáp. updates_install = Khởi động lại và cài đặt updates_installing = Đang khởi động lại vào overpressure recovery… updates_failed = Không thành công: %s @@ -1795,7 +1795,7 @@ updates_download = Unduh updates_downloading = Mengunduh %s updates_background = Unduhan tetap berjalan saat Anda menutup dasbor. updates_ready = %s siap dipasang. -updates_ready_how = Headset dimulai ulang ke overpressure recovery, yang memasang pembaruan dalam sekitar 20 menit. Game dan data Anda tetap ada. Diperlukan baterai 40 % atau kabel. +updates_ready_how = Headset dimulai ulang ke overpressure recovery, yang memasang pembaruan dalam sekitar 10 menit. Game dan data Anda tetap ada. Diperlukan baterai 40 % atau kabel. updates_install = Mulai ulang dan pasang updates_installing = Memulai ulang ke overpressure recovery… updates_failed = Tidak berhasil: %s @@ -1855,7 +1855,7 @@ updates_download = Muat turun updates_downloading = Memuat turun %s updates_background = Muat turun diteruskan apabila anda menutup papan pemuka. updates_ready = %s sedia untuk dipasang. -updates_ready_how = Set kepala dimulakan semula ke overpressure recovery, yang memasang kemas kini dalam kira-kira 20 minit. Permainan dan data anda kekal. Perlu bateri 40 % atau kabel. +updates_ready_how = Set kepala dimulakan semula ke overpressure recovery, yang memasang kemas kini dalam kira-kira 10 minit. Permainan dan data anda kekal. Perlu bateri 40 % atau kabel. updates_install = Mulakan semula dan pasang updates_installing = Memulakan semula ke overpressure recovery… updates_failed = Tidak berjaya: %s From 53a5148c37bb33e6ed9c33962f21e56d1a72dd42 Mon Sep 17 00:00:00 2001 From: Xenolphthalein <21215869+Xenolphthalein@users.noreply.github.com> Date: Wed, 2 Dec 2026 15:17:20 +0100 Subject: [PATCH 6/9] feat(pico4-monado): the setup and Overpressure Settings in the overpressure client's look Both panels follow the client (pico4_ui.hpp): its colour tokens, a top bar with the way back, grouped cards with rows and tiles, pills, the headset's picture (librsvg), line icons drawn on a 24 px grid; every control registers where it is drawn (pico4_ui_hits.h), so the laser's hover and press find it, and the thumbstick scrolls lists and moves the lenses. The setup comes in the order it can be done: the controllers first, hands-free (the station listens at once; the page shows the two buttons and a countdown, goes on by itself once both are there), then the lens distance by the thumbstick with a sharpness star, then language, time zone, Wi-Fi and done; the welcome page and Skip are gone. Overpressure Settings opens on a home with the headset, an update button while a release waits and a tile per page, and gains an About page with every part's version. The pairing page is shared (pico4_pair_ui.hpp). New texts in all 31 languages, machine-assisted; unused ones removed. --- phoenix/pico4-monado/PKGBUILD | 43 +- .../pico4-monado/overpressure-settings.cpp | 1287 ++++++++----- phoenix/pico4-monado/pico4-headset.svg | 28 + phoenix/pico4-monado/pico4-onboarding.cpp | 1114 +++++------ phoenix/pico4-monado/pico4-onboarding.strings | 1643 ++++++++++++----- phoenix/pico4-monado/pico4_lens_panel.h | 69 +- phoenix/pico4-monado/pico4_onboarding.h | 40 +- phoenix/pico4-monado/pico4_pair_ui.hpp | 104 ++ phoenix/pico4-monado/pico4_panels.hpp | 36 - phoenix/pico4-monado/pico4_settings.h | 139 +- phoenix/pico4-monado/pico4_setup.h | 143 +- phoenix/pico4-monado/pico4_ui.hpp | 644 +++++++ phoenix/pico4-monado/pico4_ui_hits.h | 101 + phoenix/pico4-monado/test_pico4_lens_panel.c | 27 +- phoenix/pico4-monado/test_pico4_onboarding.c | 10 +- phoenix/pico4-monado/test_pico4_settings.c | 63 +- phoenix/pico4-monado/test_pico4_setup.c | 45 +- tests/test_onboarding_texts.py | 2 +- 18 files changed, 3525 insertions(+), 2013 deletions(-) create mode 100644 phoenix/pico4-monado/pico4-headset.svg create mode 100644 phoenix/pico4-monado/pico4_pair_ui.hpp create mode 100644 phoenix/pico4-monado/pico4_ui.hpp create mode 100644 phoenix/pico4-monado/pico4_ui_hits.h diff --git a/phoenix/pico4-monado/PKGBUILD b/phoenix/pico4-monado/PKGBUILD index 97f9f84..5d6be73 100644 --- a/phoenix/pico4-monado/PKGBUILD +++ b/phoenix/pico4-monado/PKGBUILD @@ -23,9 +23,9 @@ pkgrel=23 arch=(aarch64) url="https://monado.freedesktop.org" license=(BSL-1.0) -depends=(openxr vulkan-icd-loader libusb systemd-libs dbus libcap libdrm libffi libx11 libxau libxcb +depends=(openxr vulkan-icd-loader libusb systemd-libs dbus libcap libdrm libffi libx11 libxau libxcb librsvg libxdmcp wayland gcc-libs glibc opencv libbsd cairo pango fontconfig glib2) -makedepends=(git cmake ninja eigen vulkan-headers glslang python cairo pango fontconfig) +makedepends=(git cmake ninja eigen vulkan-headers glslang python cairo pango fontconfig librsvg) # Loaded at runtime (VIT); without it the HMD stays on 3DoF. optdepends=('pico4-basalt: 6DoF head tracking') provides=(openxr-runtime) @@ -42,6 +42,7 @@ source=("monado::git+https://gitlab.freedesktop.org/monado/monado.git#commit=$_c pico4_passthrough.h pico4_passthrough.c pico4_roomview.h pico4-roomview.c pico4_lens_panel.h test_pico4_lens_panel.c pico4_settings.h overpressure-settings.cpp test_pico4_settings.c pico4_overlay.hpp pico4_panels.hpp pico4_pairing.h pico4_onboarding.h pico4-onboarding.cpp test_pico4_onboarding.c + pico4_ui.hpp pico4_ui_hits.h pico4_pair_ui.hpp pico4-headset.svg pico4_setup.h pico4_text.hpp test_pico4_setup.c pico4-onboarding.strings pico4-steamvr-switch.cpp pico4_slam.h pico4_slam.c pico4_slam_feed.h pico4_blemcu.h pico4_blemcu.c pico4_controller.h pico4_controller.c pico4_fusion.h pico4_fusion.c test_pico4_tracking.c test_pico4_fusion.c @@ -90,21 +91,25 @@ sha256sums=(SKIP 'ae0e6142841aba8f4bdccc40347f2669b06a10dabe7c4119ea074335b179ad11' '54aa815f0d7e4a1370b94cf1e51c3ce84c38d6bdad66d7e2a41e56ed598efbd8' 'e160944ec154fa5caf43d2177396656c8561d1739df07510ce75c3b8ddafa3b3' - '175f5769b65092ccd746309d6dcf9637b430960cc895b15ff103f8455b117bed' - '22304e9a08ef83f9165f329ee704e342971a5d781add852af782474d320caed9' - '96250102f5a1a6f73ef47f973a1f8af675889b78a07b22c26fe2a945f6b27acf' - '051ee5e8391e842cb4b0532b0f248d1b2f283d3c9ffaf2391b1177b3cb0f7d17' - '9f2b2c05e15c82059cfb5a9a019ae7e66390f228ef16a2a2ae5c10d9af0fc0d8' + '07e474ecbbb1e3a629735c123fe83cb1c9ca7c4dedf34392e1f99e06bdbf37c2' + 'de4add87e8b087f7e1edfaa0212b052b435e94fde9cce0a28e8e410bcfeb6264' + '80c9b0202f41b2435f074e9148344b1556d5044c34a85d2f352fa03309d89569' + '809a439466334ceebfb1064f21dd95ee97c5551a1e49bd7323ad8c7e35c9a9ef' + '252c66a2909b3dfc656d938fa1dd863849e535f577f4b85b74e9c1b639477b87' '5cbe37ce8152ace06a53c6f0bec5b9fb6b639d9d2b86c6eb47864594112f87ab' - '4b43cde5473deea834e49e02ca14c2fb01900d0bef88c7e6d2b6546fb56b80be' + '6b0d8e8479f4282bcaaaa46d0090417fa5e1ca72a03600a9b2da95cdf71f28d5' '7aafc2f95d382c3445c98e546f32a52464183b2b9d0e05c77398c7d011aed823' - '9e9f196f447f64b3177349c95a9be86343da081569b11ba002fec342db41a2dd' - '73a1fd1797b32116158fcda29e6754ea492a1832197f146ecbc785f0f605ed53' - '7e22709542acad80b192fa0cd1ecd7e533e02a33aa233cbd5c17144331e36898' - 'fedc001568c106e488b26f2fd4418dd563351089c76af4d05c328d3cd1cf5c51' + '40d1f6de82e150d62fd55c2c7abfea96844fc1aaa799902add20b0535c835f2c' + 'de7a05f2d66dbc091d610630e8753df12060e5349beb226a3f0a44ccb1033f78' + 'b60397ec12e3d18268b642ca8683ed67d5fee7cdb744169200689486c4d19c07' + 'c3bbe7d7186939e5cc3c912bd61c81ff920e733420447114b95ac1ca0d7dd772' + '2ccb5667159360c274f83b970b7bb3da8cdb383ee05c0e5672aaaccd00e010dd' + '420836e50fa840dceeb9f0a630d64cc18701a40376c26d7826320f8b90a9018c' + '4b58a623d5ebe53c2a30ed6710f25c66da8c96b2c014525fd08b479a8abbcd83' + 'ccb6d333b26d172ac07fc2de3234883afccb2ae5ce0419cf3b067fe971d12372' '4104d15d75e3dff32b8edf5779b9a73cacd85e5a36d6bd1a8c23f928889a3cc6' - 'c282f2979f0785017a988bd439b928a733625b27417d3024e1d28f66531c91f1' - 'b66dc9d2a28e245a6ebe7ed546e32a172e963f709bb4afe72c4bf815adce2b64' + '374bd56d373143725b3a6db79f284a40350a1017eb631f63d4e8d3cd41ef20b2' + '88f2c74f8fb72878f7ba98d5c5007e6c639fe8ef7a078a546c1101e5b48c26ca' 'cc727edbad724f50656255313d81ebc56dc6c168bbe05f10f8c57cfecd3829a4' '1e216b8317b7dcbdefb623a59dedf67ab580ffcfcd5b671a5420e777ce88aea9' '58f7dba6fbdb8473b6efffd4a31ce4ce32fd485d499355802ca850923e0bcfd6' @@ -253,11 +258,11 @@ build() { pico4_cam.c pico4_station.c pico4_ssc.c -lpthread ${CC:-cc} -std=c11 -O2 -Wall -Wextra -Werror -o pico4-roomview pico4-roomview.c -lvulkan -ldl -lm ${CXX:-c++} -std=c++17 -O2 -Wall -Wextra -Werror -Wno-unused-parameter -Wno-missing-field-initializers -isystem monado/src/external/openvr_includes \ - $(pkg-config --cflags pangocairo fontconfig) -o overpressure-settings overpressure-settings.cpp \ - $(pkg-config --libs pangocairo fontconfig) -lcairo -lvulkan -ldl -lm + $(pkg-config --cflags pangocairo fontconfig librsvg-2.0) -o overpressure-settings overpressure-settings.cpp \ + $(pkg-config --libs pangocairo fontconfig librsvg-2.0) -lcairo -lvulkan -ldl -lm ${CXX:-c++} -std=c++17 -O2 -Wall -Wextra -Werror -Wno-unused-parameter -Wno-missing-field-initializers -isystem monado/src/external/openvr_includes \ - $(pkg-config --cflags pangocairo fontconfig) -o pico4-onboarding pico4-onboarding.cpp \ - $(pkg-config --libs pangocairo fontconfig) -lcairo -lvulkan -ldl -lm + $(pkg-config --cflags pangocairo fontconfig librsvg-2.0) -o pico4-onboarding pico4-onboarding.cpp \ + $(pkg-config --libs pangocairo fontconfig librsvg-2.0) -lcairo -lvulkan -ldl -lm ${CXX:-c++} -std=c++17 -O2 -Wall -Wextra -Werror -Wno-unused-parameter -Wno-missing-field-initializers -isystem monado/src/external/openvr_includes \ -o pico4-steamvr-switch pico4-steamvr-switch.cpp -lcairo -lvulkan -ldl -lm ${CXX:-c++} -std=c++17 -O2 -Wall -Wextra -Werror -isystem /usr/include/eigen3 -o pico4-ctrack-replay \ @@ -286,6 +291,8 @@ package() { ln -s /opt/steamvr/resources/input/default_pico_controller_remapping.json "$input/default_pico_controller_remapping.json" install -Dm755 overpressure-settings pico4-onboarding pico4-steamvr-switch -t "$pkgdir/usr/bin" install -Dm644 pico4-onboarding.strings "$pkgdir/usr/share/pico4/onboarding.strings" + # The headset's picture on the panels (the overpressure client's art for it). + install -Dm644 pico4-headset.svg "$pkgdir/usr/share/pico4/headset.svg" install -Dm755 pico4-openxr-pose pico4-openxr-display pico4-cam pico4-ctrack-replay pico4-roomview -t "$pkgdir/usr/bin" # The loader's system-wide active runtime. install -dm755 "$pkgdir/etc/openxr/1" diff --git a/phoenix/pico4-monado/overpressure-settings.cpp b/phoenix/pico4-monado/overpressure-settings.cpp index 160a3a0..523bbba 100644 --- a/phoenix/pico4-monado/overpressure-settings.cpp +++ b/phoenix/pico4-monado/overpressure-settings.cpp @@ -2,24 +2,28 @@ // SPDX-License-Identifier: BSL-1.0 /* * overpressure-settings: Overpressure Settings, a tab in SteamVR's dashboard (docs/session.md#settings) - * for what the PICO 4 cannot do the Steam Frame's way, laid out as SteamVR's own settings: a menu on - * the left, the chosen page on the right (pico4_settings.h). + * for what the PICO 4 cannot do the Steam Frame's way, in the overpressure client's look + * (pico4_ui.hpp): a home with the headset and a tile for each page, each page with its way back. * * - Lens distance. The lenses have no wheel, and SteamVR shows the IPD when it changes but has no - * control that sets it: a slider, buttons for half a millimetre, and four presets for people - * taking turns (a press moves the lenses, holding one stores the distance in it), from 58 to 72 mm - * as on PICO OS: closer than 62 mm only after its warning's box is ticked (pico4_panel_gate). - * pico4-lens moves the lenses, and the driver hands the new distance to SteamVR. + * control that sets it: a slider, buttons for half a millimetre, the thumbstick (left and right), + * and four presets for people taking turns (a press moves the lenses, holding one stores the + * distance in it), from 58 to 72 mm as on PICO OS: closer than 62 mm only after its warning's box + * is ticked (pico4_panel_gate). pico4-lens moves the lenses, and the driver hands the new distance + * to SteamVR. * - Controllers. SteamVR cannot pair the PICO 4's controllers: each one's state, and Pair for a - * missing one, through the driver's pairing socket (pico4_station.h), while the page says what - * to press. With no controller connected 20 s after the start, the laser cannot reach anything: - * the page comes up in front of the wearer and the station listens for one controller after the - * other. pico4-onboarding pairs them itself during the first-run setup. + * missing one, through the driver's pairing socket (pico4_station.h), while the page says what to + * press. With no controller connected 20 s after the start, the laser cannot reach anything: the + * pairing comes up in front of the wearer and the station listens for one controller after the + * other (pico4_pair_ui.hpp, as the setup's first step). pico4-onboarding pairs them itself during + * the first-run setup. * - Updates. The system's updates come from overpressure's updater, not Valve's: the installed * release, a newer one on its channel with its notes, the download's progress (it goes on with the * dashboard closed), Restart and install, and a failure's reason with Try again. The page reads * `overpressure-update status` while it shows and starts the updater's units * (overpressure-update@STEP.service), which the session may start (overpressure-base's polkit rule). + * - About. Every part's version in one list: the system's release and commit, overpressure, the + * recovery, the packages release, the kernel, SteamVR, Mesa and the headset's driver. * * In Steam's language, with the texts of pico4-onboarding.strings. Nothing of Valve's is linked: * libopenvr_api.so is opened at run time. @@ -28,11 +32,15 @@ * * --render draws the pages into DIR as PNG files, without SteamVR, in LANGUAGE (Steam's name). */ +#include "pico4_pair_ui.hpp" #include "pico4_pairing.h" #include "pico4_panels.hpp" #include "pico4_settings.h" +#include "pico4_ui.hpp" +#include #include +#include #include #include @@ -43,6 +51,7 @@ namespace { using namespace pico4_overlay; using namespace pico4_panels; +using namespace pico4_ui; volatile sig_atomic_t g_stop; @@ -52,18 +61,35 @@ stop_requested(int) g_stop = 1; } -//! The panel in front of the wearer: the controllers' page under its title. -constexpr int kFrontW = PICO4_PANEL_W; -constexpr int kFrontH = (int)PICO4_SETTINGS_PAGE_Y + PICO4_PANEL_H; //! Seconds both controllers stay shown on the panel in front before it goes. constexpr double kBothShown = 3.0; +//! The controls, as their boxes register while a page draws (pico4_ui_hits.h). +enum Id +{ + kBack = 1, + kTileLenses, + kTileControllers, + kTileUpdates, + kTileAbout, + kHeaderUpdate, + kLensMinus, + kLensPlus, + kLensSlider, + kLensWarning, + kPreset0, + kPairLeft = kPreset0 + PICO4_PANEL_PRESETS, + kPairRight, + kUpdateAction, + kFrontClose, +}; + struct Lenses { double mm = 0; //!< What the driver reports; 0 before the first reading. double target = 0; //!< Where the lenses are going, or a slider being dragged; 0: nowhere. double presets[PICO4_PANEL_PRESETS] = {}; - int pressed = PICO4_PANEL_NONE; + int pressed_preset = -1; bool stored = false; //!< The pressed preset was just stored. double pressed_at = 0; const char *message = nullptr; //!< a failure's text key @@ -72,6 +98,7 @@ struct Lenses bool warning = false; //!< The warning below 62 mm shows (pico4_panel_warning_after). bool confirmed = false; //!< Its box is ticked: closer than 62 mm goes, until the page closes. double drag_from = 0; //!< Where the slider's drag started; 0: no drag. + double slider_x0 = 0, slider_x1 = 1; //!< The slider's ends, as last drawn. }; struct Controllers @@ -79,10 +106,10 @@ struct Controllers bool known = false; //!< The driver answered a status. bool left = false, right = false; int pairing = 0; //!< The hand being paired: 1 left, 2 right. + double pairing_at = 0; int last_hands_free = 0; bool hands_free = false; //!< Pairing started because no controller was there. const char *message = nullptr; //!< a failure's text key - int pressed = PICO4_CONTROLLERS_NONE; }; //! A program run beside the loop: its output read as it comes, its end found without waiting. @@ -154,55 +181,40 @@ struct Child struct Updates { struct pico4_updates status = {}; - bool pressed = false; const char *message = nullptr; //!< a failure's text key Child reader; //!< overpressure-update status Child starter; //!< systemctl start of a step's unit double next = 0; //!< when to read the status again long long started = 0; //!< when a step's button was let go (seconds since 1970), until the updater answers - double animated = 0; //!< when the moving bar was last drawn + double animated = 0; //!< when the moving parts were last drawn }; -//! Seconds a step shows from its press without the updater's word, before the old status counts again. -constexpr long long kStepHold = 10; -//! Seconds between frames of the moving bar. -constexpr double kAnimation = 1.0 / 15; - -//! Whether the page shows a moving bar: a step whose progress cannot be measured (yet). -bool -updates_moving(const struct pico4_updates &s) +//! Every part's version, read when the About page opens (and the release for the home's facts). +struct About { - return s.state == PICO4_UPDATES_CHECKING || s.state == PICO4_UPDATES_INSTALLING || - (s.state == PICO4_UPDATES_DOWNLOADING && s.total <= 0); -} + std::string release, commit, overpressure, flavour, recovery, packages, kernel, linux_release, steamvr, mesa, driver; + int first = 0; //!< the list's first row shown +}; struct State { - enum pico4_settings_page page = PICO4_SETTINGS_LENSES; - int pressed_entry = PICO4_SETTINGS_NONE; + enum pico4_settings_page page = PICO4_SETTINGS_HOME; Lenses lens; Controllers ctl; Updates up; + About about; + struct pico4_hits hits; //!< the tab's controls, as last drawn + struct pico4_hits front_hits; //!< the panel in front's + int hover = PICO4_HIT_NONE, pressed = PICO4_HIT_NONE; + int front_hover = PICO4_HIT_NONE, front_pressed = PICO4_HIT_NONE; }; -//! Start the updater's step @p step (its unit, which the session may start), without waiting for it. -void -start_step(Updates &u, const char *step) -{ - const std::string unit = std::string("overpressure-update@") + step + ".service"; - const char *const argv[] = {"systemctl", "start", "--no-block", unit.c_str(), nullptr}; - if (!u.starter.start(argv, false)) { - u.message = "updates_start_failed"; - return; - } - // The step shows at once; the updater's own status takes over as soon as it writes one. - u.message = nullptr; - u.started = (long long)time(nullptr); - u.status.state = pico4_updates_starting(step); - u.status.part[0] = '\0'; - u.status.done = u.status.total = 0; - u.next = 0; -} +//! Seconds a step shows from its press without the updater's word, before the old status counts again. +constexpr long long kStepHold = 10; +//! Seconds between frames of what moves. +constexpr double kAnimation = 1.0 / 15; +//! The About list's rows shown at once. +constexpr int kAboutRows = 4; std::string presets_path() @@ -213,6 +225,81 @@ presets_path() return dir + "/presets"; } +// -- Reading what the About page and the home show ----------------------------------------------------- + +//! The version of the first of @p names that pacman's database of the image holds, "" when none. +std::string +package_version(std::initializer_list names) +{ + for (const char *db : {"/usr/lib/holo/pacmandb/local", "/var/lib/pacman/local"}) { + DIR *d = opendir(db); + if (d == nullptr) { + continue; + } + std::string found; + while (dirent *e = readdir(d)) { + char v[96]; + for (const char *name : names) { + if (found.empty() && pico4_about_package(e->d_name, name, v, sizeof(v))) { + found = v; + } + } + } + closedir(d); + if (!found.empty()) { + return found; + } + } + return ""; +} + +std::string +json_text(const std::string &json, const char *key) +{ + char out[160]; + return pico4_json_field(json.c_str(), key, out, sizeof(out)) ? out : ""; +} + +std::string +version_value(const std::string &file, const char *key) +{ + char out[160]; + return pico4_about_value(file.c_str(), key, out, sizeof(out)) ? out : ""; +} + +void +read_about(About &a, bool everything) +{ + const std::string release = read_file("/usr/lib/overpressure/release.json"), version = read_file("/usr/share/pico4/version"); + a.release = json_text(release, "version"); + a.commit = json_text(release, "commit"); + a.overpressure = json_text(release, "overpressure"); + a.flavour = json_text(release, "flavour"); + if (a.release.empty()) { + a.release = version_value(version, "version"); + } + if (!everything) { + return; + } + a.recovery = json_text(read_file("/data/var/lib/overpressure/recovery.json"), "overpressure"); + a.packages = version_value(version, "packages"); + a.kernel = version_value(version, "kernel"); + struct utsname u; + a.linux_release = uname(&u) == 0 ? u.release : ""; + a.steamvr = package_version({"deckard-steamvr-rel", "steamvr"}); + a.mesa = package_version({"deckard-mesa-linux-aarch64", "mesa"}); + a.driver = package_version({"pico4-monado"}); +} + +//! The system's name as the owner knows it: its flavour. +std::string +flavour_name(const std::string &key) +{ + return key == "overpressure-os" ? "overpressure OS" : "SteamOS"; +} + +// -- Lenses --------------------------------------------------------------------------------------------- + void start_move(Lenses &l, double mm) { @@ -270,470 +357,521 @@ reap_mover(Lenses &l) return true; } -// -- Drawing -------------------------------------------------------------------------------------- - -const double kWhite[3] = {1, 1, 1}, kDim[3] = {0.65, 0.67, 0.70}, kText[3] = {0.85, 0.87, 0.90}; - -void -colour(cairo_t *c, const double rgb[3]) +//! The distance shown: where the lenses go, else where they are. +double +shown_mm(const Lenses &l) { - cairo_set_source_rgb(c, rgb[0], rgb[1], rgb[2]); + return l.target > 0 ? l.target : l.mm; } +// -- Updates ----------------------------------------------------------------------------------------- + +//! Start the updater's step @p step (its unit, which the session may start), without waiting for it. void -box(cairo_t *c, double x, double y, double w, double h, bool pressed, bool selected, double r = 14) +start_step(Updates &u, const char *step) { - rounded(c, x, y, w, h, r); - if (pressed) { - cairo_set_source_rgb(c, 0.20, 0.44, 0.72); - } else if (selected) { - cairo_set_source_rgb(c, 0.16, 0.36, 0.60); - } else { - cairo_set_source_rgb(c, 0.22, 0.24, 0.27); + const std::string unit = std::string("overpressure-update@") + step + ".service"; + const char *const argv[] = {"systemctl", "start", "--no-block", unit.c_str(), nullptr}; + if (!u.starter.start(argv, false)) { + u.message = "updates_start_failed"; + return; } - cairo_fill(c); + // The step shows at once; the updater's own status takes over as soon as it writes one. + u.message = nullptr; + u.started = (long long)time(nullptr); + u.status.state = pico4_updates_starting(step); + u.status.part[0] = '\0'; + u.status.done = u.status.total = 0; + u.next = 0; } -//! @p text centred in the box at (@p x, @p y, @p w, @p h). -void -centred(cairo_t *c, const std::string &text, double x, double y, double w, double h, double size, bool bold) +//! Whether the updates page shows something that moves: a step whose progress cannot be measured (yet). +bool +updates_moving(const struct pico4_updates &s) { - const double tall = pico4_text::draw(c, text, x, 0, w, size, bold, pico4_text::kCenter, true); - pico4_text::draw(c, text, x, y + (h - tall) / 2, w, size, bold, pico4_text::kCenter); + return s.state == PICO4_UPDATES_CHECKING || s.state == PICO4_UPDATES_INSTALLING || s.state == PICO4_UPDATES_UNKNOWN || + (s.state == PICO4_UPDATES_DOWNLOADING && s.total <= 0); } -void -button(cairo_t *c, double x, double y, double w, double h, const std::string &label, bool pressed, bool primary) +//! A newer release waits: offered, or downloaded and ready. +bool +update_waits(const struct pico4_updates &s) { - box(c, x, y, w, h, pressed, primary); - colour(c, kWhite); - centred(c, label, x + 8, y, w - 16, h, 26, true); + return s.state == PICO4_UPDATES_AVAILABLE || s.state == PICO4_UPDATES_READY; } -//! The lens distance page, in the page's pixels. -void -draw_lenses(cairo_t *c, const Lenses &l, const Texts &t) +//! The text key naming a download's part (the updater's status), nullptr for one this page does not know. +const char * +updates_part(const char *part) { - const double shown = l.target > 0 ? l.target : l.mm; - char line[64]; - colour(c, kWhite); - snprintf(line, sizeof(line), shown > 0 ? "%.1f mm" : "--", shown); - centred(c, line, 0, 70, PICO4_PANEL_W, 100, 70, true); + return strcmp(part, "update") == 0 ? "updates_part_update" + : strcmp(part, "kernel") == 0 ? "updates_part_kernel" + : strcmp(part, "packages") == 0 ? "updates_part_packages" + : nullptr; +} - const double row = PICO4_PANEL_ROW1_Y, h = PICO4_PANEL_ROW1_H, w = PICO4_PANEL_BUTTON_W; - const double plus_x = PICO4_PANEL_W - PICO4_PANEL_BUTTON_X0 - w; - box(c, PICO4_PANEL_BUTTON_X0, row, w, h, l.pressed == PICO4_PANEL_MINUS, false); - box(c, plus_x, row, w, h, l.pressed == PICO4_PANEL_PLUS, false); - colour(c, kWhite); - centred(c, "\xE2\x88\x92", PICO4_PANEL_BUTTON_X0, row, w, h, 52, true); - centred(c, "+", plus_x, row, w, h, 52, true); +// -- Drawing ------------------------------------------------------------------------------------------ - // The slider: a track, an amber bar under its part below 62 mm, its filled part and a knob at the distance. - const double track = row + h / 2, close_x = pico4_panel_slider_x(PICO4_PANEL_MM_CLOSE); - rounded(c, PICO4_PANEL_SLIDER_X0, track - 5, PICO4_PANEL_SLIDER_X1 - PICO4_PANEL_SLIDER_X0, 10, 5); - cairo_set_source_rgb(c, 0.30, 0.33, 0.37); - cairo_fill(c); - rounded(c, PICO4_PANEL_SLIDER_X0, track + 11, close_x - PICO4_PANEL_SLIDER_X0, 5, 2.5); - cairo_set_source_rgb(c, 0.85, 0.60, 0.20); - cairo_fill(c); - if (shown > 0) { - const double knob = pico4_panel_slider_x(shown); - rounded(c, PICO4_PANEL_SLIDER_X0, track - 5, knob - PICO4_PANEL_SLIDER_X0, 10, 5); - cairo_set_source_rgb(c, 0.27, 0.56, 0.90); - cairo_fill(c); - cairo_arc(c, knob, track, l.pressed == PICO4_PANEL_SLIDER ? 22 : 18, 0, 2 * M_PI); - cairo_set_source_rgb(c, 1, 1, 1); +constexpr double kColX = 80, kColW = PICO4_SETTINGS_W - 2 * kColX; //!< a page's column +constexpr double kContentY = kTopbarH + 24; + +//! The home: the headset with its facts (and a waiting update), a tile for each page, the controllers' state. +void +draw_home(cairo_t *c, const Frame &f, const State &s, const Texts &t) +{ + topbar(c, f, t.our("settings_title"), "", PICO4_HIT_NONE, kIcons, ""); + const double x = 64, y = kTopbarH + 32, art = 104; + headset_art(c, x, y, art); + set(c, kText); + pico4_text::line(c, "PICO 4", x + art + 28, y + 4, 520, 40, true); + std::string facts = flavour_name(s.about.flavour); + if (!s.about.release.empty()) { + facts += " \xC2\xB7 " + s.about.release; + } + if (shown_mm(s.lens) > 0) { + char mm[32]; + snprintf(mm, sizeof(mm), " \xC2\xB7 %.1f mm", shown_mm(s.lens)); + facts += mm; + } + set(c, kMuted); + pico4_text::line(c, facts, x + art + 28, y + 62, 560, kSmall, false); + if (update_waits(s.up.status) && s.up.status.version[0] != '\0') { + const std::string label = fill(t.our("updates_update_to"), s.up.status.version); + const double bw = text_width(c, label, kButtonText, true) + 28 + 12 + 64; + button(c, f, kHeaderUpdate, f.w - 64 - bw, y + (art - kButtonH) / 2, bw, label, kUpdate, kUp); + } + // The tiles. + const struct + { + int id; + Icon icon; + const char *key; + } tiles[] = {{kTileLenses, kLenses, "setup_ipd_title"}, + {kTileControllers, kController, "controllers_title"}, + {kTileUpdates, kDownload, "updates_title"}, + {kTileAbout, kInfo, "about_title"}}; + const double ty = y + art + 48, th = 200, gap = 24, tw = (f.w - 2 * x - 3 * gap) / 4; + for (int i = 0; i < 4; i++) { + const double tx = x + i * (tw + gap); + const bool hover = f.hover == tiles[i].id || f.pressed == tiles[i].id; + fill_box(c, tx, ty, tw, th, kTileR, hover ? kHover : kPanel); + if (hover) { + hover_ring(c, tx, ty, tw, th, kTileR); + } + chip(c, tiles[i].icon, tx + (tw - 72) / 2, ty + 36, 72, kSurface, kText); + set(c, kText); + pico4_text::draw(c, t.our(tiles[i].key), tx + 12, ty + 128, tw - 24, kButtonText, true, pico4_text::kCenter); + if (tiles[i].id == kTileUpdates && update_waits(s.up.status)) { + cairo_arc(c, tx + tw - 30, ty + 30, 14, 0, 2 * M_PI); + set(c, kUpdateBg); + cairo_fill(c); + line_mid(c, "1", tx + tw - 35, ty + 30, 20, 18, true, kUpdateText); + } + pico4_hits_add(f.hits, tiles[i].id, tx, ty, tw, th); + } + // The controllers' state, in a line under them. + if (s.ctl.known) { + const bool both = s.ctl.left && s.ctl.right; + const double ly = ty + th + 40; + cairo_arc(c, x + 6, ly, 6, 0, 2 * M_PI); + set(c, both ? kGreen : kOrange); cairo_fill(c); + line_mid(c, t.our(both ? "home_controllers_both" : "home_controller_missing"), x + 24, ly, 700, kSmall, false, kMuted); } - colour(c, kDim); - centred(c, "58", PICO4_PANEL_SLIDER_X0 - 22, row + h - 4, 60, 24, 18, false); - centred(c, "62", close_x - 30, row + h - 4, 60, 24, 18, false); - centred(c, "72", PICO4_PANEL_SLIDER_X1 - 38, row + h - 4, 60, 24, 18, false); +} - // Below 62 mm, PICO OS's warning with its box, in the presets' row. +//! The lens distance: the distance large, the warning's room, −, the slider and +; then the presets. +void +draw_lenses(cairo_t *c, const Frame &f, State &s, const Texts &t) +{ + Lenses &l = s.lens; + topbar(c, f, t.our("setup_ipd_title"), t.our("settings_title"), kBack, kStick, t.our("thumb_lr")); + const double shown = shown_mm(l); + const double gy = kContentY, gh = 304, pad = 32; + group(c, kColX, gy, kColW, gh); + char value[32]; + snprintf(value, sizeof(value), shown > 0 ? "%.1f" : "\xE2\x80\x94", shown); + const bool close = shown > 0 && shown < PICO4_PANEL_MM_CLOSE; + set(c, close ? kOrange : kText); + pico4_text::line(c, value, kColX + pad, gy + 18, 300, 60, true); + const double vw = text_width(c, value, 60, true); + set(c, kMuted); + pico4_text::line(c, "mm", kColX + pad + vw + 12, gy + 46, 80, 28, false); + // The room for the warning, or the range (or a failure): nothing moves when it shows. + const double slot_y = gy + 96, slot_h = 104, inner_w = kColW - 2 * pad; if (l.warning) { - close_warning(c, t.our("lens_close_warning"), PICO4_PANEL_PRESET_X0, PICO4_PANEL_ROW2_Y, - PICO4_PANEL_W - 2 * PICO4_PANEL_PRESET_X0, PICO4_PANEL_ROW2_H, l.confirmed, - l.pressed == PICO4_PANEL_WARNING); + const bool hover = f.hover == kLensWarning || f.pressed == kLensWarning; + fill_box(c, kColX + pad, slot_y, inner_w, slot_h, 16, kWarnBg); + pico4_overlay::rounded(c, kColX + pad + 0.5, slot_y + 0.5, inner_w - 1, slot_h - 1, 16); + set(c, hover ? kWarnHeading : kWarnLine); + cairo_set_line_width(c, hover ? 2 : 1); + cairo_stroke(c); + set(c, kWarnText); + pico4_text::line(c, t.our("lens_close_short"), kColX + pad + 20, slot_y + 12, inner_w - 40, kSmall, false); + tick_box(c, kColX + pad + 20, slot_y + 54, 34, l.confirmed, kWarnHeading); + line_mid(c, t.our("lens_closer"), kColX + pad + 68, slot_y + 71, inner_w - 90, kSmall, true, kWarnHeading); + pico4_hits_add(f.hits, kLensWarning, kColX + pad, slot_y, inner_w, slot_h); + } else { + const bool failed = l.message != nullptr; + set(c, failed ? kBadText : kMuted); + pico4_text::draw(c, t.our(failed ? l.message : "setup_ipd_range"), kColX + pad, slot_y + 36, inner_w, kSmall, false); } - for (int i = 0; i < PICO4_PANEL_PRESETS && !l.warning; i++) { - const double x = PICO4_PANEL_PRESET_X0 + i * (PICO4_PANEL_PRESET_W + PICO4_PANEL_PRESET_GAP); - const double y = PICO4_PANEL_ROW2_Y; + // −, the slider (the range below 62 mm marked) and +. + const double ry = slot_y + slot_h + 8, bx1 = kColX + kColW - pad - kButtonH; + button(c, f, kLensMinus, kColX + pad, ry, kButtonH, "", kSecondary, kMinus); + button(c, f, kLensPlus, bx1, ry, kButtonH, "", kSecondary, kPlus); + l.slider_x0 = kColX + pad + kButtonH + 40; + l.slider_x1 = bx1 - 40; + const double mid = ry + kButtonH / 2, sw = l.slider_x1 - l.slider_x0; + fill_box(c, l.slider_x0, mid - 4, sw, 8, 4, kTrack); + fill_box(c, l.slider_x0, mid + 10, pico4_panel_slider_x(PICO4_PANEL_MM_CLOSE, l.slider_x0, l.slider_x1) - l.slider_x0, 4, + 2, kOrange); + if (shown > 0) { + const double knob = pico4_panel_slider_x(shown, l.slider_x0, l.slider_x1); + fill_box(c, l.slider_x0, mid - 4, knob - l.slider_x0, 8, 4, kBlue); + const bool hover = f.hover == kLensSlider || f.pressed == kLensSlider; + cairo_arc(c, knob, mid, hover ? 23 : 20, 0, 2 * M_PI); + set(c, kWhite); + cairo_fill(c); + } + pico4_hits_add(f.hits, kLensSlider, l.slider_x0 - 20, ry, sw + 40, kButtonH); + // The presets, for people taking turns. + const double py = gy + gh + 24, ph = f.h - 20 - py; + group(c, kColX, py, kColW, ph); + group_label(c, t.our("lens_people"), kColX + pad, py + 22, inner_w); + const double tgap = 16, tw = (kColW - 2 * 24 - 3 * tgap) / 4, tile_y = py + 58, tile_h = ph - 58 - 22; + for (int i = 0; i < PICO4_PANEL_PRESETS; i++) { + const double tx = kColX + 24 + i * (tw + tgap); + const int id = kPreset0 + i; const bool here = l.presets[i] > 0 && shown > 0 && fabs(l.presets[i] - shown) < 0.15; - box(c, x, y, PICO4_PANEL_PRESET_W, PICO4_PANEL_ROW2_H, l.pressed == PICO4_PANEL_PRESET0 + i, here); + const bool hover = f.hover == id || f.pressed == id; + fill_box(c, tx, tile_y, tw, tile_h, 18, here ? kSelected : hover ? kButtonHover : kSurface); + if (hover) { + hover_ring(c, tx, tile_y, tw, tile_h, 18); + } char number[8]; snprintf(number, sizeof(number), "%d", i + 1); - cairo_set_source_rgb(c, 0.75, 0.78, 0.82); - centred(c, fill(t.our("lens_preset"), number), x + 6, y + 12, PICO4_PANEL_PRESET_W - 12, 30, 22, false); - colour(c, kWhite); - if (l.pressed == PICO4_PANEL_PRESET0 + i && l.stored) { - centred(c, t.our("lens_stored"), x + 6, y + 50, PICO4_PANEL_PRESET_W - 12, 46, 28, true); + set(c, kMuted); + pico4_text::draw(c, fill(t.our("lens_preset"), number), tx + 8, tile_y + 10, tw - 16, 20, false, pico4_text::kCenter); + if (l.pressed_preset == i && l.stored) { + set(c, kGoodText); + pico4_text::draw(c, t.our("lens_stored"), tx + 8, tile_y + 40, tw - 16, 26, true, pico4_text::kCenter); } else if (l.presets[i] > 0) { snprintf(number, sizeof(number), "%.1f", l.presets[i]); - centred(c, number, x + 6, y + 50, PICO4_PANEL_PRESET_W - 12, 46, 36, true); + set(c, kText); + pico4_text::draw(c, number, tx + 8, tile_y + 38, tw - 16, 30, true, pico4_text::kCenter); } else { - cairo_set_source_rgb(c, 0.55, 0.58, 0.62); - centred(c, t.our("lens_empty"), x + 6, y + 50, PICO4_PANEL_PRESET_W - 12, 46, 24, false); + set(c, kMuted); + pico4_text::draw(c, t.our("lens_hold"), tx + 8, tile_y + 44, tw - 16, 20, false, pico4_text::kCenter); } - } - - if (l.message != nullptr) { - cairo_set_source_rgb(c, 0.95, 0.55, 0.45); - } else { - colour(c, kDim); - } - // The presets' hint only with the presets. - if (l.message != nullptr || !l.warning) { - pico4_text::draw(c, t.our(l.message != nullptr ? l.message : "lens_hint"), 30, 440, PICO4_PANEL_W - 60, 22, false, - pico4_text::kCenter); + pico4_hits_add(f.hits, id, tx, tile_y, tw, tile_h); } } -//! The controllers' page, in the page's pixels; @p close for the panel in front of the wearer. +//! The controllers: each hand's state, Pair for a missing one, and how they connect. void -draw_controllers(cairo_t *c, const Controllers &s, const Texts &t, bool close, int close_pressed) +draw_controllers(cairo_t *c, const Frame &f, const State &s, const Texts &t) { + const Controllers &k = s.ctl; + topbar(c, f, t.our("controllers_title"), t.our("settings_title"), kBack, kIcons, ""); + const double rh = 112, gy = kContentY; + group(c, kColX, gy, kColW, 2 * rh); for (int hand = 1; hand <= 2; hand++) { - const bool on = hand == 1 ? s.left : s.right; - const double y = PICO4_CONTROLLERS_ROW_Y + (hand - 1) * PICO4_CONTROLLERS_ROW_STEP; - rounded(c, 0, y, PICO4_CONTROLLERS_W, PICO4_CONTROLLERS_ROW_H, 12); - cairo_set_source_rgb(c, 0.17, 0.18, 0.21); - cairo_fill(c); - const std::string state = !s.known ? "..." : on ? t.our("controller_connected") - : s.pairing == hand ? t.our("controller_waiting") - : t.our("controller_missing"); - cairo_set_source_rgb(c, on ? 0.55 : 0.95, on ? 0.85 : 0.75, on ? 0.55 : 0.45); - const std::string text = fill(t.our(hand == 1 ? "controller_left" : "controller_right"), state); - const double tall = pico4_text::draw(c, text, 24, 0, PICO4_CONTROLLERS_PAIR_X - 40, 28, false, pico4_text::kStart, true); - pico4_text::draw(c, text, 24, y + (PICO4_CONTROLLERS_ROW_H - tall) / 2, PICO4_CONTROLLERS_PAIR_X - 40, 28, false); - if (s.known && !on && s.pairing == 0) { - button(c, PICO4_CONTROLLERS_PAIR_X, y + PICO4_CONTROLLERS_PAIR_INSET, PICO4_CONTROLLERS_PAIR_W, - PICO4_CONTROLLERS_ROW_H - 2 * PICO4_CONTROLLERS_PAIR_INSET, t.our("pair"), - s.pressed == (hand == 1 ? PICO4_CONTROLLERS_PAIR_LEFT : PICO4_CONTROLLERS_PAIR_RIGHT), false); + const bool on = hand == 1 ? k.left : k.right; + const double ry = gy + (hand - 1) * rh; + if (hand == 2) { + row_line(c, kColX + 32, ry, kColW - 64); + } + chip(c, kController, kColX + 32, ry + 20, 72, on ? kGoodBg : kSurface, on ? kGoodText : kMuted); + set(c, kText); + pico4_text::line(c, t.our(hand == 1 ? "controller_left_name" : "controller_right_name"), kColX + 128, + on ? ry + rh / 2 - kBody * 0.62 : ry + 22, 520, kBody, true); + std::string help; + if (!k.known) { + help = "\xE2\x80\xA6"; + } else if (on) { + help.clear(); // the pill says it + } else if (k.pairing == hand) { + const double left = std::max(0.0, PICO4_PAIRING_LISTEN_S - (f.now - k.pairing_at)); + help = fill(t.our("pair_listening"), pico4_pair_ui::clock_text((int)std::ceil(left))); + } else { + help = t.our("status_missing"); + } + set(c, kMuted); + pico4_text::line(c, help, kColX + 128, ry + 62, 560, kSmall, false); + const double right = kColX + kColW - 32; + if (on) { + pill(c, t.our("status_connected"), right, ry + rh / 2, kGood, true); + } else if (k.pairing == hand) { + spinner(c, right - 20, ry + rh / 2, 16, f.now); + } else if (k.known && k.pairing == 0) { + const std::string pair = t.our("pair"); + const double bw = text_width(c, pair, kButtonText, true) + 64; + button(c, f, hand == 1 ? kPairLeft : kPairRight, right - bw, ry + (rh - kButtonH) / 2, bw, pair, kSecondary); } } - colour(c, kText); - double y = PICO4_CONTROLLERS_TEXT_Y; - const double w = PICO4_CONTROLLERS_W; - const int missing = pico4_pairing_missing(s.left, s.right); - if (s.pairing != 0) { - y += pico4_text::draw(c, t.our(s.pairing == 1 ? "controller_pair_left" : "controller_pair_right"), 0, y, w, 26, false) + 12; - pico4_text::draw(c, t.our("controller_pair_how"), 0, y, w, 26, false); - } else if (s.left && s.right) { - pico4_text::draw(c, t.our("controllers_both"), 0, y, w, 26, false); - } else if (missing != 0) { - pico4_text::draw(c, t.our(missing == 1 ? "controller_point_left" : "controller_point_right"), 0, y, w, 26, false); - } - if (s.message != nullptr) { - cairo_set_source_rgb(c, 0.95, 0.55, 0.45); - pico4_text::draw(c, t.our(s.message), 0, close ? PICO4_CONTROLLERS_CLOSE_Y + 20 : PICO4_CONTROLLERS_CLOSE_Y, close ? PICO4_CONTROLLERS_PAIR_X - 20 : w, - 22, false); - } - if (close) { - button(c, PICO4_CONTROLLERS_PAIR_X, PICO4_CONTROLLERS_CLOSE_Y, PICO4_CONTROLLERS_PAIR_W, PICO4_CONTROLLERS_CLOSE_H, - t.our("close"), close_pressed == PICO4_CONTROLLERS_CLOSE, true); - } -} - -//! The updates' button's text key for the step @p action starts in @p u's state. -const char * -updates_button(const struct pico4_updates &u, const char *action) -{ - if (u.state == PICO4_UPDATES_FAILED) { - return "updates_retry"; + set(c, kMuted); + double y = gy + 2 * rh + 28; + y += pico4_text::draw(c, t.our("controllers_both"), kColX + 8, y, kColW - 16, kSmall, false) + 12; + if (k.message != nullptr) { + set(c, kBadText); + pico4_text::draw(c, t.our(k.message), kColX + 8, y, kColW - 16, kSmall, false); } - return strcmp(action, "download") == 0 ? "updates_download" : strcmp(action, "install") == 0 ? "updates_install" : "updates_check"; } -//! The text key naming a download's part (the updater's status), NULL for one this page does not know. -const char * -updates_part(const char *part) -{ - return strcmp(part, "update") == 0 ? "updates_part_update" - : strcmp(part, "kernel") == 0 ? "updates_part_kernel" - : strcmp(part, "packages") == 0 ? "updates_part_packages" - : nullptr; -} - -//! The updates' page, in the page's pixels from its margin. +//! The updates: the release as a row with its step's button, its notes in their own group. void -draw_updates(cairo_t *c, const Updates &u, const Texts &t) +draw_updates(cairo_t *c, const Frame &f, const State &st, const Texts &t) { + const Updates &u = st.up; const struct pico4_updates &s = u.status; - const double w = PICO4_UPDATES_W; - if (s.installed[0] != '\0') { - colour(c, kDim); - pico4_text::draw(c, fill(t.our("updates_installed"), s.installed), 0, 0, w, 22, false); - } - std::string head, body; - bool failed = false; + topbar(c, f, t.our("updates_title"), t.our("settings_title"), kBack, kIcons, ""); + const char *action = pico4_updates_action(&s); + std::string name, help, button_label; + Icon chip_icon = kDownload; + Rgb chip_back = kSurface, chip_ink = kText; + bool round = false, spin = false, moving_bar = false, failed = false; + const std::string installed = s.installed[0] != '\0' ? fill(t.our("updates_installed"), s.installed) : ""; switch (s.state) { - case PICO4_UPDATES_IDLE: head = s.current ? t.our("updates_current") : ""; break; - case PICO4_UPDATES_CHECKING: head = t.our("updates_checking"); break; + case PICO4_UPDATES_IDLE: + if (s.current) { + chip_icon = kCheck, chip_back = kGoodBg, chip_ink = kGoodText; + name = t.our("updates_current"); + help = installed; + } else { + name = installed; + } + break; + case PICO4_UPDATES_CHECKING: + chip_icon = kRefresh; + name = t.our("updates_checking"); + moving_bar = true; + break; case PICO4_UPDATES_AVAILABLE: - head = fill(t.our("updates_available"), s.title[0] != '\0' ? s.title : s.version); - body = s.notes; + round = true, chip_back = kBlueBg, chip_ink = kBlueText; + name = fill(t.our("updates_available"), s.title[0] != '\0' ? s.title : s.version); + help = installed; + break; + case PICO4_UPDATES_DOWNLOADING: { + round = true, chip_back = kBlueBg, chip_ink = kBlueText; + name = fill(t.our("updates_downloading"), s.version); + const char *part = updates_part(s.part); + help = part != nullptr ? t.our(part) : ""; + if (s.total > 0) { + char bytes[48]; + pico4_updates_bytes(s.done, s.total, bytes, sizeof(bytes)); + help += (help.empty() ? "" : ": ") + std::string(bytes); + } break; - case PICO4_UPDATES_DOWNLOADING: head = fill(t.our("updates_downloading"), s.version); break; + } case PICO4_UPDATES_READY: - head = fill(t.our("updates_ready"), s.version); - body = t.our("updates_ready_how"); + chip_icon = kCheck, chip_back = kGoodBg, chip_ink = kGoodText; + name = fill(t.our("updates_ready"), s.version); + help = t.our("updates_ready_how"); + break; + case PICO4_UPDATES_INSTALLING: + spin = true; + name = t.our("updates_installing"); break; - case PICO4_UPDATES_INSTALLING: head = t.our("updates_installing"); break; case PICO4_UPDATES_FAILED: - head = fill(t.our("updates_failed"), s.reason); + chip_icon = kAlert, chip_back = kBadBg, chip_ink = kBadText; + name = fill(t.our("updates_failed"), s.reason); failed = true; break; - default: head = "..."; break; + default: + spin = true; + name = "\xE2\x80\xA6"; + break; } - double y = 60; - if (failed) { - cairo_set_source_rgb(c, 0.95, 0.55, 0.45); + if (action != nullptr) { + button_label = t.our(s.state == PICO4_UPDATES_FAILED ? "updates_retry" + : strcmp(action, "download") == 0 ? "updates_download" + : strcmp(action, "install") == 0 ? "updates_install" + : "updates_check"); + } + // The row: its height from its words. + const double pad = 32, chip_s = 72, text_x = kColX + pad + chip_s + 24; + const double bw = button_label.empty() ? 0 : text_width(c, button_label, kButtonText, true) + 64; + const double text_w = kColX + kColW - pad - (bw > 0 ? bw + 24 : 0) - text_x; + const double name_h = pico4_text::draw(c, name, text_x, 0, text_w, kBody, true, pico4_text::kStart, true); + const double help_h = help.empty() ? 0 : pico4_text::draw(c, help, text_x, 0, text_w, kSmall, false, pico4_text::kStart, true); + const bool bar_shown = moving_bar || s.state == PICO4_UPDATES_DOWNLOADING; + const double inner = name_h + (bar_shown ? 30 : 0) + (help_h > 0 ? help_h + 6 : 0); + const double rh = std::max(136.0, inner + 48), gy = kContentY; + group(c, kColX, gy, kColW, rh); + const double cy = gy + rh / 2; + if (spin) { + spinner(c, kColX + pad + chip_s / 2, cy, 18, f.now); } else { - colour(c, kWhite); + chip(c, chip_icon, kColX + pad, cy - chip_s / 2, chip_s, chip_back, chip_ink, round); } - if (!head.empty()) { - y += pico4_text::draw(c, head, 0, y, w, 30, true) + 24; + double ty = cy - inner / 2; + set(c, failed ? kBadText : kText); + pico4_text::draw(c, name, text_x, ty, text_w, kBody, true); + ty += name_h; + if (bar_shown) { + bar(c, text_x, ty + 12, text_w, moving_bar || s.total <= 0 ? -1 : pico4_updates_fraction(&s), f.now); + ty += 30; } - if (s.state == PICO4_UPDATES_DOWNLOADING || updates_moving(s)) { - // The bar: how much of the part is there, or, while that cannot be measured, a segment moving along it. - rounded(c, 0, y, w, 16, 8); - cairo_set_source_rgb(c, 0.30, 0.33, 0.37); - cairo_fill(c); - cairo_set_source_rgb(c, 0.27, 0.56, 0.90); - if (updates_moving(s)) { - const double segment = w / 4, along = fmod(now_s() / 1.5, 1.0) * (w + segment) - segment; - cairo_save(c); - cairo_rectangle(c, 0, y, w, 16); - cairo_clip(c); - rounded(c, along, y, segment, 16, 8); - cairo_fill(c); - cairo_restore(c); - } else { - const double done = pico4_updates_fraction(&s); - if (done > 0) { - rounded(c, 0, y, w * done > 16 ? w * done : 16, 16, 8); - cairo_fill(c); - } - } - y += 34; - if (s.state == PICO4_UPDATES_DOWNLOADING) { - // What it fetches now, with its bytes once their number is known, and that it goes on without the dashboard. - const char *part = updates_part(s.part); - std::string line = part != nullptr ? t.our(part) : ""; - if (s.total > 0) { - char bytes[48]; - pico4_updates_bytes(s.done, s.total, bytes, sizeof(bytes)); - line += (line.empty() ? "" : ": ") + std::string(bytes); - } - if (!line.empty()) { - colour(c, kDim); - y += pico4_text::draw(c, line, 0, y, w, 22, false) + 20; - } - colour(c, kText); - pico4_text::draw(c, t.our("updates_background"), 0, y, w, 22, false); - } - } else if (!body.empty()) { - // A release's notes may run long: they stop above the button. + if (help_h > 0) { + set(c, kMuted); + pico4_text::draw(c, help, text_x, ty + 6, text_w, kSmall, false); + } + if (bw > 0) { + const bool main = strcmp(action, "download") == 0 || strcmp(action, "install") == 0; + button(c, f, kUpdateAction, kColX + kColW - pad - bw, cy - kButtonH / 2, bw, button_label, + main && !failed ? kPrimaryKind : kSecondary); + } + double y = gy + rh + 24; + // The release's notes, and that the download goes on without the dashboard. + if (s.state == PICO4_UPDATES_DOWNLOADING) { + set(c, kMuted); + y += pico4_text::draw(c, t.our("updates_background"), kColX + 8, y, kColW - 16, kSmall, false) + 16; + } else if (s.notes[0] != '\0' && (s.state == PICO4_UPDATES_AVAILABLE || s.state == PICO4_UPDATES_READY)) { + const double nh = std::min(f.h - 24 - y, 58 + pico4_text::draw(c, s.notes, 0, 0, kColW - 2 * pad, kSmall, false, + pico4_text::kStart, true) + 24); + group(c, kColX, y, kColW, nh); + group_label(c, t.our("updates_whats_new"), kColX + pad, y + 22, kColW - 2 * pad); cairo_save(c); - cairo_rectangle(c, 0, y, w, PICO4_UPDATES_BUTTON_Y - 20 - y); + cairo_rectangle(c, kColX, y + 50, kColW, nh - 60); cairo_clip(c); - colour(c, kText); - pico4_text::draw(c, body, 0, y, w, 22, false); + set(c, kText); + pico4_text::draw(c, s.notes, kColX + pad, y + 58, kColW - 2 * pad, kSmall, false); cairo_restore(c); - } - const char *action = pico4_updates_action(&s); - if (action != nullptr) { - button(c, PICO4_UPDATES_BUTTON_X, PICO4_UPDATES_BUTTON_Y, PICO4_UPDATES_BUTTON_W, PICO4_UPDATES_BUTTON_H, - t.our(updates_button(s, action)), u.pressed, true); + y += nh + 16; } if (u.message != nullptr) { - cairo_set_source_rgb(c, 0.95, 0.55, 0.45); - pico4_text::draw(c, t.our(u.message), 0, PICO4_UPDATES_BUTTON_Y + 20, PICO4_UPDATES_BUTTON_X - 20, 22, false); + set(c, kBadText); + pico4_text::draw(c, t.our(u.message), kColX + 8, y, kColW - 16, kSmall, false); } } -const char *const kPageTitles[PICO4_SETTINGS_PAGES] = {"setup_ipd_title", "controllers_title", "updates_title"}; - +//! About: the headset, then every part's version, scrolled by the thumbstick. void -title(cairo_t *c, const std::string &text, double x, double w) +draw_about(cairo_t *c, const Frame &f, State &s, const Texts &t) { - colour(c, kWhite); - pico4_text::line(c, text, x, PICO4_SETTINGS_TITLE_Y, w, 36, true); + const About &a = s.about; + topbar(c, f, t.our("about_title"), t.our("settings_title"), kBack, kStickV, t.our("thumb_scroll")); + const double art = 88, hy = kContentY; + headset_art(c, kColX, hy, art); + set(c, kText); + pico4_text::line(c, "PICO 4", kColX + art + 24, hy + 8, 600, 34, true); + set(c, kMuted); + pico4_text::line(c, "overpressure \xC2\xB7 " + flavour_name(a.flavour), kColX + art + 24, hy + 52, 600, kSmall, false); + const std::string none = "\xE2\x80\x94"; + auto or_none = [&](const std::string &v) { return v.empty() ? none : v; }; + const struct + { + std::string label, value, note; + } rows[] = { + {t.our("about_system"), or_none(a.release), a.commit}, + {"overpressure", or_none(a.overpressure), ""}, + {t.our("about_recovery"), or_none(a.recovery), ""}, + {t.our("about_packages"), or_none(a.packages), ""}, + {t.our("about_kernel"), or_none(a.kernel), a.linux_release}, + {"SteamVR", or_none(a.steamvr), ""}, + {"Mesa", or_none(a.mesa), ""}, + {t.our("about_driver"), or_none(a.driver), "pico4-monado"}, + }; + const int count = (int)(sizeof(rows) / sizeof(rows[0])); + s.about.first = pico4_list_scroll(s.about.first, 0, kAboutRows, count); + const double gy = hy + art + 24, rh = 72, list_y = gy + 56, pad = 32; + group(c, kColX, gy, kColW, 56 + kAboutRows * rh + 12); + group_label(c, t.our("about_versions"), kColX + pad, gy + 22, kColW - 2 * pad); + cairo_save(c); + cairo_rectangle(c, kColX, list_y, kColW, kAboutRows * rh); + cairo_clip(c); + for (int r = 0; r < kAboutRows && s.about.first + r < count; r++) { + const auto &row = rows[s.about.first + r]; + const double ry = list_y + r * rh; + if (r > 0) { + row_line(c, kColX + pad, ry, kColW - 2 * pad); + } + line_mid(c, row.label, kColX + pad, ry + rh / 2, 320, kBody, false, kText); + // The value at the right in a fixed-width face; what it is beside it, muted. + PangoLayout *layout = pango_cairo_create_layout(c); + PangoFontDescription *font = pango_font_description_from_string("Adwaita Mono, DejaVu Sans Mono, monospace"); + pango_font_description_set_absolute_size(font, 23 * PANGO_SCALE); + pango_font_description_set_weight(font, PANGO_WEIGHT_SEMIBOLD); + pango_layout_set_font_description(layout, font); + pango_layout_set_text(layout, row.value.c_str(), -1); + int vw, vh; + pango_layout_get_pixel_size(layout, &vw, &vh); + const double vx = kColX + kColW - pad - 16 - vw; + set(c, kText); + cairo_move_to(c, vx, ry + (rh - vh) / 2); + pango_cairo_show_layout(c, layout); + pango_font_description_free(font); + g_object_unref(layout); + if (!row.note.empty()) { + const double nw = std::min(text_width(c, row.note, 18, false), vx - 24 - (kColX + 340)); + if (nw > 40) { + set(c, kMuted); + pico4_text::line(c, row.note, vx - 20 - nw, ry + rh / 2 - 12, nw + 2, 18, false); + } + } + } + cairo_restore(c); + scroll_track(c, kColX + kColW - 14, list_y + 4, kAboutRows * rh - 8, s.about.first, kAboutRows, count); } void -draw_tab(cairo_surface_t *surface, const State &s, const Texts &t) +draw_tab(cairo_surface_t *surface, State &s, const Texts &t, double now) { cairo_t *c = cairo_create(surface); - cairo_set_source_rgb(c, 0.11, 0.12, 0.14); - cairo_paint(c); - // The menu. - cairo_rectangle(c, 0, 0, PICO4_SETTINGS_MENU_W, PICO4_SETTINGS_H); - cairo_set_source_rgb(c, 0.08, 0.09, 0.11); - cairo_fill(c); - colour(c, kWhite); - pico4_text::draw(c, t.our("settings_title"), 24, 30, PICO4_SETTINGS_MENU_W - 48, 26, true); - for (int i = 0; i < PICO4_SETTINGS_PAGES; i++) { - const double y = PICO4_SETTINGS_ENTRY_Y + i * PICO4_SETTINGS_ENTRY_STEP; - if (s.pressed_entry == i || s.page == i) { - box(c, PICO4_SETTINGS_ENTRY_X, y, PICO4_SETTINGS_ENTRY_W, PICO4_SETTINGS_ENTRY_H, s.pressed_entry == i, true, 10); - } - colour(c, s.page == i ? kWhite : kText); - const std::string label = t.our(kPageTitles[i]); - const double tall = pico4_text::draw(c, label, 0, 0, PICO4_SETTINGS_ENTRY_W - 40, 24, false, pico4_text::kStart, true); - pico4_text::draw(c, label, PICO4_SETTINGS_ENTRY_X + 20, y + (PICO4_SETTINGS_ENTRY_H - tall) / 2, - PICO4_SETTINGS_ENTRY_W - 40, 24, s.page == i); - } - // The page. - title(c, t.our(kPageTitles[s.page]), PICO4_SETTINGS_PAGE_X + 30, PICO4_PANEL_W - 60); - cairo_save(c); - cairo_translate(c, PICO4_SETTINGS_PAGE_X, PICO4_SETTINGS_PAGE_Y); - if (s.page == PICO4_SETTINGS_LENSES) { - draw_lenses(c, s.lens, t); - } else if (s.page == PICO4_SETTINGS_CONTROLLERS) { - cairo_translate(c, PICO4_CONTROLLERS_MARGIN, 0); - draw_controllers(c, s.ctl, t, false, PICO4_CONTROLLERS_NONE); - } else { - cairo_translate(c, PICO4_UPDATES_MARGIN, 0); - draw_updates(c, s.up, t); + pico4_hits_clear(&s.hits); + Frame f{PICO4_SETTINGS_W, PICO4_SETTINGS_H, &s.hits, s.hover, s.pressed, now}; + background(c, f); + switch (s.page) { + case PICO4_SETTINGS_LENSES: draw_lenses(c, f, s, t); break; + case PICO4_SETTINGS_CONTROLLERS: draw_controllers(c, f, s, t); break; + case PICO4_SETTINGS_UPDATES: draw_updates(c, f, s, t); break; + case PICO4_SETTINGS_ABOUT: draw_about(c, f, s, t); break; + default: draw_home(c, f, s, t); break; } - cairo_restore(c); cairo_destroy(c); cairo_surface_flush(surface); } +//! The pairing in front of the wearer, as the setup's first step, with Close. void -draw_front(cairo_surface_t *surface, const Controllers &s, const Texts &t) +draw_front(cairo_surface_t *surface, State &s, const Texts &t, double now) { cairo_t *c = cairo_create(surface); - cairo_set_source_rgb(c, 0.11, 0.12, 0.14); - cairo_paint(c); - title(c, t.our("controllers_title"), 30, kFrontW - 60); - cairo_translate(c, PICO4_CONTROLLERS_MARGIN, PICO4_SETTINGS_PAGE_Y); - draw_controllers(c, s, t, true, s.pressed); + pico4_hits_clear(&s.front_hits); + Frame f{PICO4_FRONT_W, PICO4_FRONT_H, &s.front_hits, s.front_hover, s.front_pressed, now}; + background(c, f); + pico4_pair_ui::Pairing p; + p.known = s.ctl.known; + p.left = s.ctl.left; + p.right = s.ctl.right; + p.pairing = s.ctl.pairing; + p.listen_left = std::max(0.0, PICO4_PAIRING_LISTEN_S - (now - s.ctl.pairing_at)); + p.message = s.ctl.message != nullptr ? t.our(s.ctl.message) : ""; + topbar(c, f, t.our("controllers_title"), "", PICO4_HIT_NONE, kIcons, ""); + pico4_pair_ui::hand_pills(c, f, t, p); + pico4_pair_ui::content(c, f, t, p, true, false); + footer(c, f); + const std::string close = t.our("close"); + const double bw = text_width(c, close, kButtonText, true) + 64; + button(c, f, kFrontClose, f.w - kSide - bw, footer_y(f), bw, close, kSecondary); cairo_destroy(c); cairo_surface_flush(surface); } -//! The tab's icon: three sliders. +//! The tab's icon: the lens distance's chip on the panel's background. void draw_thumbnail(cairo_surface_t *surface) { cairo_t *c = cairo_create(surface); - cairo_set_source_rgb(c, 0.11, 0.12, 0.14); + set(c, kBg); cairo_paint(c); - const double knobs[3] = {90, 170, 120}; - for (int i = 0; i < 3; i++) { - const double y = 68 + i * 60; - rounded(c, 40, y - 6, 176, 12, 6); - cairo_set_source_rgb(c, 0.55, 0.58, 0.62); - cairo_fill(c); - cairo_arc(c, knobs[i], y, 20, 0, 2 * M_PI); - cairo_set_source_rgb(c, 1, 1, 1); - cairo_fill(c); - } + chip(c, kLenses, 48, 48, 160, kSurface, kBlue); cairo_destroy(c); cairo_surface_flush(surface); } -// -- Input ---------------------------------------------------------------------------------------- - -//! A mouse event on the lens distance page at (@p x, @p y) of the page; true when it changed it. -bool -lenses_event(Lenses &l, const vr::VREvent_t &e, double x, double y) -{ - switch (e.eventType) { - case vr::VREvent_MouseButtonDown: - l.pressed = pico4_panel_hit(x, y, l.warning); - l.pressed_at = now_s(); - l.stored = false; - if (l.pressed == PICO4_PANEL_SLIDER && l.mm > 0) { - l.drag_from = l.target > 0 ? l.target : l.mm; - } - [[fallthrough]]; - case vr::VREvent_MouseMove: - // The knob stops at 62 mm, with the warning, as long as its box is not ticked. - if (l.pressed == PICO4_PANEL_SLIDER && l.drag_from > 0) { - bool refused; - l.target = pico4_panel_gate(l.drag_from, pico4_panel_slider_mm(x), l.confirmed, &refused); - l.warning = pico4_panel_warning_after(l.warning, refused, l.target); - return true; - } - return e.eventType == vr::VREvent_MouseButtonDown; - case vr::VREvent_MouseButtonUp: { - const double from = l.target > 0 ? l.target : l.mm; - const int was = l.pressed; - const bool stored = l.stored; - l.pressed = PICO4_PANEL_NONE; - l.stored = false; - if (was == PICO4_PANEL_WARNING && pico4_panel_hit(x, y, l.warning) == PICO4_PANEL_WARNING) { - l.confirmed = !l.confirmed; - return true; - } - if (was == PICO4_PANEL_SLIDER) { - const double start = l.drag_from; - l.drag_from = 0; - if (start > 0 && fabs(l.target - start) >= 0.01) { - start_move(l, l.target); - } - return true; - } - if (from <= 0) { - return true; - } - if (was == PICO4_PANEL_MINUS) { - request_move(l, from, from - PICO4_PANEL_STEP_MM); - } else if (was == PICO4_PANEL_PLUS) { - request_move(l, from, from + PICO4_PANEL_STEP_MM); - } else if (was >= PICO4_PANEL_PRESET0 && was < PICO4_PANEL_PRESET0 + PICO4_PANEL_PRESETS && !stored && - l.presets[was] > 0) { - request_move(l, from, l.presets[was]); - } - return true; - } - default: return false; - } -} - -/*! - * A mouse event on the controllers' page at (@p x, @p y) of the page; returns the widget let go - * on (the one pressed), PICO4_CONTROLLERS_NONE otherwise. - */ -int -controllers_event(Controllers &s, const vr::VREvent_t &e, double x, double y, bool close) -{ - const bool pair = s.known && s.pairing == 0; - const int at = pico4_controllers_hit(x, y, pair && !s.left, pair && !s.right, close); - if (e.eventType == vr::VREvent_MouseButtonDown) { - s.pressed = at; - } else if (e.eventType == vr::VREvent_MouseButtonUp) { - const int was = s.pressed; - s.pressed = PICO4_CONTROLLERS_NONE; - return was == at ? was : PICO4_CONTROLLERS_NONE; - } - return PICO4_CONTROLLERS_NONE; -} - -//! A mouse event on the updates' page at (@p x, @p y) of the page; its button starts the next step. -bool -updates_event(Updates &u, const vr::VREvent_t &e, double x, double y) -{ - const char *action = pico4_updates_action(&u.status); - const bool on = pico4_updates_hit(x, y, action != nullptr); - if (e.eventType == vr::VREvent_MouseButtonDown) { - u.pressed = on; - return true; - } - if (e.eventType == vr::VREvent_MouseButtonUp) { - if (u.pressed && on && !u.starter.active()) { - start_step(u, action); - } - u.pressed = false; - return true; - } - return false; -} +// -- Rendering without SteamVR -------------------------------------------------------------------------- //! @p text into the status field @p field, cut to its size. template @@ -749,77 +887,92 @@ render(const char *dir, const char *language) Texts t; t.load(language != nullptr ? language : "english"); int r = 0; + cairo_surface_t *tab = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, PICO4_SETTINGS_W, PICO4_SETTINGS_H); + cairo_surface_t *front = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, PICO4_FRONT_W, PICO4_FRONT_H); auto save = [&](cairo_surface_t *surface, const char *name) { const std::string file = std::string(dir) + "/" + name + ".png"; r |= cairo_surface_write_to_png(surface, file.c_str()) != CAIRO_STATUS_SUCCESS; }; - cairo_surface_t *tab = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, PICO4_SETTINGS_W, PICO4_SETTINGS_H); - cairo_surface_t *front = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, kFrontW, kFrontH); State s; + s.about = {"2026.12.0b1", "2026.12.0b0-13-g8b9e107", "2026.12.0b1", "steamos", "2026.12.0b1", "2026.12.1", + "phoenix/7.2-11", "7.2.0-phoenix", "2.9.4-1", "26.1.6-1", "25.1.0-23", 0}; s.lens.mm = 64.0; s.lens.presets[0] = 63.5; s.lens.presets[1] = 64.0; - draw_tab(tab, s, t); + s.ctl.known = true; + s.ctl.left = true; + struct pico4_updates &u = s.up.status; + u.state = PICO4_UPDATES_AVAILABLE; + put(u.installed, "2026.12.0b1"); + put(u.version, "2026.12.0b2"); + put(u.title, "PICO 4 2026.12.0 beta 2"); + put(u.notes, "Updates from Overpressure Settings, over the headset's own network\nThe recovery installs a signed update " + "without a computer\nThe setup starts with the controllers and the lenses"); + s.page = PICO4_SETTINGS_HOME; + s.hover = kTileLenses; + draw_tab(tab, s, t, 0); + save(tab, "settings-home"); + s.hover = PICO4_HIT_NONE; + s.page = PICO4_SETTINGS_LENSES; + draw_tab(tab, s, t, 0); save(tab, "settings-lenses"); s.lens.mm = 62.0; s.lens.warning = true; - draw_tab(tab, s, t); + draw_tab(tab, s, t, 0); save(tab, "settings-lenses-close"); s.lens.confirmed = true; s.lens.mm = 60.5; - draw_tab(tab, s, t); + draw_tab(tab, s, t, 0); save(tab, "settings-lenses-close-ticked"); + s.lens = Lenses(); + s.lens.mm = 64.0; s.page = PICO4_SETTINGS_CONTROLLERS; - s.ctl.known = true; - s.ctl.left = true; - draw_tab(tab, s, t); + draw_tab(tab, s, t, 0); save(tab, "settings-controllers"); - s.ctl.left = false; - s.ctl.pairing = 1; - s.ctl.hands_free = true; - draw_front(front, s.ctl, t); - save(front, "settings-front-pairing"); - // The updates' page in each state that shows more than a line. + s.ctl.pairing = 2; + draw_tab(tab, s, t, 0.4); + save(tab, "settings-controllers-pairing"); + s.ctl.pairing = 0; s.page = PICO4_SETTINGS_UPDATES; - struct pico4_updates &u = s.up.status; - u.state = PICO4_UPDATES_AVAILABLE; - put(u.installed, "2026.12.0b1"); - put(u.version, "2026.12.0b2"); - put(u.title, "PICO 4 2026.12.0 beta 2"); - put(u.notes, "Changes\n- Updates from Overpressure Settings, over the headset's own network\n- The recovery installs a " - "signed update without a computer\n- Lens distance presets keep their place"); - draw_tab(tab, s, t); + draw_tab(tab, s, t, 0); save(tab, "settings-updates-available"); u.state = PICO4_UPDATES_CHECKING; - draw_tab(tab, s, t); + draw_tab(tab, s, t, 0.3); save(tab, "settings-updates-checking"); u.state = PICO4_UPDATES_DOWNLOADING; - put(u.part, "kernel"); - u.done = 154492; - u.total = 154492; - draw_tab(tab, s, t); - save(tab, "settings-updates-downloading-kernel"); put(u.part, "packages"); - u.done = u.total = 0; - draw_tab(tab, s, t); - save(tab, "settings-updates-downloading-unknown"); u.done = 1200ll << 20; u.total = 2900ll << 20; - draw_tab(tab, s, t); + draw_tab(tab, s, t, 0); save(tab, "settings-updates-downloading"); u.state = PICO4_UPDATES_READY; - draw_tab(tab, s, t); + draw_tab(tab, s, t, 0); save(tab, "settings-updates-ready"); u.state = PICO4_UPDATES_FAILED; put(u.step, "install"); put(u.reason, "the battery is below 40 %: charge the headset or plug it in, then try again"); - draw_tab(tab, s, t); + draw_tab(tab, s, t, 0); save(tab, "settings-updates-failed"); u.state = PICO4_UPDATES_IDLE; u.current = true; put(u.installed, "2026.12.0b2"); - draw_tab(tab, s, t); + draw_tab(tab, s, t, 0); save(tab, "settings-updates-current"); + s.page = PICO4_SETTINGS_ABOUT; + draw_tab(tab, s, t, 0); + save(tab, "settings-about"); + s.about.first = 4; + draw_tab(tab, s, t, 0); + save(tab, "settings-about-scrolled"); + s.ctl.left = false; + s.ctl.pairing = 1; + s.ctl.pairing_at = -21; + draw_front(front, s, t, 0.5); + save(front, "settings-front-pairing"); + s.ctl.left = true; + s.ctl.pairing = 2; + draw_front(front, s, t, 0.5); + save(front, "settings-front-pairing-right"); cairo_surface_destroy(tab); cairo_surface_destroy(front); return r; @@ -863,10 +1016,12 @@ main(int argc, char **argv) return 1; } const vr::HmdVector2_t tab_scale = {{(float)PICO4_SETTINGS_W, (float)PICO4_SETTINGS_H}}; - const vr::HmdVector2_t front_scale = {{(float)kFrontW, (float)kFrontH}}; + const vr::HmdVector2_t front_scale = {{(float)PICO4_FRONT_W, (float)PICO4_FRONT_H}}; overlay->SetOverlayWidthInMeters(tab, 2.2f); overlay->SetOverlayInputMethod(tab, vr::VROverlayInputMethod_Mouse); overlay->SetOverlayMouseScale(tab, &tab_scale); + // The thumbstick: up and down scroll a list, left and right move the lenses. + overlay->SetOverlayFlag(tab, vr::VROverlayFlags_SendVRDiscreteScrollEvents, true); overlay->SetOverlayWidthInMeters(front, 0.96f); overlay->SetOverlayInputMethod(front, vr::VROverlayInputMethod_Mouse); overlay->SetOverlayMouseScale(front, &front_scale); @@ -875,11 +1030,12 @@ main(int argc, char **argv) overlay->SetOverlaySortOrder(front, 100); cairo_surface_t *tab_surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, PICO4_SETTINGS_W, PICO4_SETTINGS_H); - cairo_surface_t *front_surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, kFrontW, kFrontH); + cairo_surface_t *front_surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, PICO4_FRONT_W, PICO4_FRONT_H); Gpu gpu; Texture tab_texture, front_texture, thumbnail_texture; if (!gpu_create(gpu, vrs.compositor, "overpressure-settings") || !texture_create(gpu, thumbnail_texture, 256, 256) || - !texture_create(gpu, tab_texture, PICO4_SETTINGS_W, PICO4_SETTINGS_H) || !texture_create(gpu, front_texture, kFrontW, kFrontH)) { + !texture_create(gpu, tab_texture, PICO4_SETTINGS_W, PICO4_SETTINGS_H) || + !texture_create(gpu, front_texture, PICO4_FRONT_W, PICO4_FRONT_H)) { fprintf(stderr, "overpressure-settings: no Vulkan textures\n"); return 1; } @@ -895,8 +1051,12 @@ main(int argc, char **argv) fflush(stdout); State s; + pico4_hits_clear(&s.hits); + pico4_hits_clear(&s.front_hits); Lenses &l = s.lens; Controllers &k = s.ctl; + Updates &up = s.up; + read_about(s.about, false); const std::string path = presets_path(); pico4_panel_presets_load(path.c_str(), l.presets); Front placement; @@ -913,6 +1073,7 @@ main(int argc, char **argv) k.hands_free = hands_free; if (pair.start(text)) { k.pairing = hand; + k.pairing_at = now_s(); k.message = nullptr; } else { k.message = "controller_radio"; @@ -932,50 +1093,142 @@ main(int argc, char **argv) both_since = 0; front_dirty = on; }; + auto open_page = [&](enum pico4_settings_page page) { + s.page = page; + s.hover = s.pressed = PICO4_HIT_NONE; + if (page == PICO4_SETTINGS_ABOUT) { + read_about(s.about, true); + s.about.first = 0; + } + up.next = 0; + tab_dirty = true; + }; + //! What a control does once let go on. + auto act = [&](int id) { + switch (id) { + case kBack: open_page(PICO4_SETTINGS_HOME); break; + case kTileLenses: open_page(PICO4_SETTINGS_LENSES); break; + case kTileControllers: open_page(PICO4_SETTINGS_CONTROLLERS); break; + case kTileUpdates: + case kHeaderUpdate: open_page(PICO4_SETTINGS_UPDATES); break; + case kTileAbout: open_page(PICO4_SETTINGS_ABOUT); break; + case kLensMinus: + case kLensPlus: + if (shown_mm(l) > 0) { + request_move(l, shown_mm(l), shown_mm(l) + (id == kLensPlus ? 1 : -1) * PICO4_PANEL_STEP_MM); + } + break; + case kLensWarning: l.confirmed = !l.confirmed; break; + case kPairLeft: + case kPairRight: start_pairing(id == kPairLeft ? 1 : 2, false); break; + case kUpdateAction: { + const char *step = pico4_updates_action(&up.status); + if (step != nullptr && !up.starter.active()) { + start_step(up, step); + } + break; + } + default: + if (id >= kPreset0 && id < kPreset0 + PICO4_PANEL_PRESETS && !l.stored && l.presets[id - kPreset0] > 0 && + shown_mm(l) > 0) { + request_move(l, shown_mm(l), l.presets[id - kPreset0]); + } + break; + } + tab_dirty = true; + }; while (running && !g_stop) { const double now = now_s(); vr::VREvent_t e; while (overlay->PollNextOverlayEvent(tab, &e, sizeof(e))) { const double x = e.data.mouse.x, y = PICO4_SETTINGS_H - e.data.mouse.y; // SteamVR's y points up - const double px = x - PICO4_SETTINGS_PAGE_X, py = y - PICO4_SETTINGS_PAGE_Y; - if (e.eventType == vr::VREvent_MouseButtonDown && x < PICO4_SETTINGS_MENU_W) { - s.pressed_entry = pico4_settings_menu_hit(x, y); - tab_dirty = true; - continue; + switch (e.eventType) { + case vr::VREvent_MouseMove: { + const int at = pico4_hits_at(&s.hits, x, y); + if (at != s.hover) { + s.hover = at; + tab_dirty = true; + } + // The slider follows the laser while held; the knob stops at 62 mm with the warning. + if (s.pressed == kLensSlider && l.drag_from > 0) { + bool refused; + l.target = pico4_panel_gate(l.drag_from, pico4_panel_slider_mm(x, l.slider_x0, l.slider_x1), l.confirmed, &refused); + l.warning = pico4_panel_warning_after(l.warning, refused, l.target); + tab_dirty = true; + } + break; } - if (e.eventType == vr::VREvent_MouseButtonUp && s.pressed_entry != PICO4_SETTINGS_NONE) { - if (s.pressed_entry == pico4_settings_menu_hit(x, y)) { - s.page = (enum pico4_settings_page)s.pressed_entry; + case vr::VREvent_FocusLeave: + s.hover = PICO4_HIT_NONE; + tab_dirty = true; + break; + case vr::VREvent_MouseButtonDown: + s.pressed = s.hover = pico4_hits_at(&s.hits, x, y); + if (s.pressed >= kPreset0 && s.pressed < kPreset0 + PICO4_PANEL_PRESETS) { + l.pressed_preset = s.pressed - kPreset0; + l.pressed_at = now; + l.stored = false; + } + if (s.pressed == kLensSlider && l.mm > 0) { + l.drag_from = shown_mm(l); + bool refused; + l.target = pico4_panel_gate(l.drag_from, pico4_panel_slider_mm(x, l.slider_x0, l.slider_x1), l.confirmed, &refused); + l.warning = pico4_panel_warning_after(l.warning, refused, l.target); } - s.pressed_entry = PICO4_SETTINGS_NONE; tab_dirty = true; - continue; - } - if (s.page == PICO4_SETTINGS_LENSES) { - tab_dirty = lenses_event(l, e, px, py) || tab_dirty; - } else if (s.page == PICO4_SETTINGS_UPDATES) { - tab_dirty = updates_event(s.up, e, px - PICO4_UPDATES_MARGIN, py) || tab_dirty; - } else if (e.eventType == vr::VREvent_MouseButtonDown || e.eventType == vr::VREvent_MouseButtonUp) { - const int done = controllers_event(k, e, px - PICO4_CONTROLLERS_MARGIN, py, false); - if (done == PICO4_CONTROLLERS_PAIR_LEFT || done == PICO4_CONTROLLERS_PAIR_RIGHT) { - start_pairing(done == PICO4_CONTROLLERS_PAIR_LEFT ? 1 : 2, false); + break; + case vr::VREvent_MouseButtonUp: { + const int was = s.pressed; + s.pressed = PICO4_HIT_NONE; + if (was == kLensSlider) { + const double from = l.drag_from; + l.drag_from = 0; + if (from > 0 && fabs(l.target - from) >= 0.01) { + start_move(l, l.target); + } + } else if (was != PICO4_HIT_NONE && was == pico4_hits_at(&s.hits, x, y)) { + act(was); } + l.pressed_preset = -1; + l.stored = false; tab_dirty = true; + break; + } + case vr::VREvent_ScrollDiscrete: { + const float dx = e.data.scroll.xdelta, dy = e.data.scroll.ydelta; + if (s.page == PICO4_SETTINGS_ABOUT && fabsf(dy) >= fabsf(dx) && dy != 0) { + s.about.first = pico4_list_scroll(s.about.first, dy > 0 ? -1 : 1, kAboutRows, 8); + tab_dirty = true; + } else if (s.page == PICO4_SETTINGS_LENSES && dx != 0 && shown_mm(l) > 0) { + request_move(l, shown_mm(l), shown_mm(l) + (dx > 0 ? 1 : -1) * PICO4_PANEL_STEP_MM); + tab_dirty = true; + } + break; + } + default: break; } } while (overlay->PollNextOverlayEvent(front, &e, sizeof(e))) { - if (e.eventType != vr::VREvent_MouseButtonDown && e.eventType != vr::VREvent_MouseButtonUp) { - continue; - } - const double x = e.data.mouse.x - PICO4_CONTROLLERS_MARGIN, y = kFrontH - e.data.mouse.y - PICO4_SETTINGS_PAGE_Y; - const int done = controllers_event(k, e, x, y, true); - if (done == PICO4_CONTROLLERS_PAIR_LEFT || done == PICO4_CONTROLLERS_PAIR_RIGHT) { - start_pairing(done == PICO4_CONTROLLERS_PAIR_LEFT ? 1 : 2, false); - } else if (done == PICO4_CONTROLLERS_CLOSE) { - show_front(false); + const double x = e.data.mouse.x, y = PICO4_FRONT_H - e.data.mouse.y; + if (e.eventType == vr::VREvent_MouseMove) { + const int at = pico4_hits_at(&s.front_hits, x, y); + front_dirty = front_dirty || at != s.front_hover; + s.front_hover = at; + } else if (e.eventType == vr::VREvent_FocusLeave) { + s.front_hover = PICO4_HIT_NONE; + front_dirty = true; + } else if (e.eventType == vr::VREvent_MouseButtonDown) { + s.front_pressed = pico4_hits_at(&s.front_hits, x, y); + front_dirty = true; + } else if (e.eventType == vr::VREvent_MouseButtonUp) { + const int was = s.front_pressed; + s.front_pressed = PICO4_HIT_NONE; + if (was == kFrontClose && was == pico4_hits_at(&s.front_hits, x, y)) { + show_front(false); + } + front_dirty = true; } - front_dirty = true; } while (system->PollNextEvent(&e, sizeof(e))) { if (e.eventType == vr::VREvent_Quit) { @@ -988,16 +1241,18 @@ main(int argc, char **argv) } } const bool visible = overlay->IsOverlayVisible(tab); - // Leaving the page clears the warning's box, as PICO OS does when its panel closes. + // Leaving the lens page clears the warning's box, as PICO OS does when its panel closes. if ((!visible || s.page != PICO4_SETTINGS_LENSES) && (l.warning || l.confirmed)) { l.warning = l.confirmed = false; tab_dirty = true; } + if (!visible && s.hover != PICO4_HIT_NONE) { + s.hover = s.pressed = PICO4_HIT_NONE; + } // The lenses: a held preset stores the distance, a finished move, the driver's distance. - if (l.pressed >= PICO4_PANEL_PRESET0 && l.pressed < PICO4_PANEL_PRESET0 + PICO4_PANEL_PRESETS && !l.stored && - now - l.pressed_at >= PICO4_PANEL_HOLD_S && l.mm > 0) { - l.presets[l.pressed] = round(l.mm * 10) / 10; + if (l.pressed_preset >= 0 && !l.stored && now - l.pressed_at >= PICO4_PANEL_HOLD_S && l.mm > 0) { + l.presets[l.pressed_preset] = round(l.mm * 10) / 10; l.stored = true; if (!pico4_panel_presets_save(path.c_str(), l.presets)) { l.message = "lens_store_failed"; @@ -1014,7 +1269,7 @@ main(int argc, char **argv) tab_dirty = true; } // The driver has caught up with the finished move. - if (l.mover <= 0 && l.pressed != PICO4_PANEL_SLIDER && l.target > 0 && now - l.pressed_at > 2.5) { + if (l.mover <= 0 && s.pressed != kLensSlider && l.target > 0 && now - l.pressed_at > 2.5) { l.target = 0; tab_dirty = true; } @@ -1083,49 +1338,55 @@ main(int argc, char **argv) placement.follow(overlay, system, front, now); } - // The updater: its status every second while its page shows, and a step's start. - Updates &u = s.up; - if (u.starter.poll()) { - if (u.starter.status != 0) { - u.message = "updates_start_failed"; - u.started = 0; // the status as it is, again + // The updater: its status every second while the updates page or the home shows, and a step's start. + if (up.starter.poll()) { + if (up.starter.status != 0) { + up.message = "updates_start_failed"; + up.started = 0; // the status as it is, again } - u.next = 0; + up.next = 0; tab_dirty = true; } - if (visible && s.page == PICO4_SETTINGS_UPDATES && !u.reader.active() && now >= u.next) { - u.next = now + 1; + const bool reads_updates = s.page == PICO4_SETTINGS_UPDATES || s.page == PICO4_SETTINGS_HOME; + if (visible && reads_updates && !up.reader.active() && now >= up.next) { + up.next = now + (s.page == PICO4_SETTINGS_UPDATES ? 1 : 5); const char *const argv[] = {"overpressure-update", "status", nullptr}; - u.reader.start(argv, true); + up.reader.start(argv, true); } - if (u.reader.poll()) { + if (up.reader.poll()) { struct pico4_updates latest; const long long wall = (long long)time(nullptr); - if (u.reader.status == 0 && pico4_updates_parse(u.reader.out.c_str(), &latest) && - pico4_updates_take(&latest, u.started, wall, kStepHold)) { - u.started = 0; - if (memcmp(&latest, &u.status, sizeof(latest)) != 0) { - u.status = latest; + if (up.reader.status == 0 && pico4_updates_parse(up.reader.out.c_str(), &latest) && + pico4_updates_take(&latest, up.started, wall, kStepHold)) { + up.started = 0; + if (memcmp(&latest, &up.status, sizeof(latest)) != 0) { + up.status = latest; tab_dirty = true; } } } - if (visible && s.page == PICO4_SETTINGS_UPDATES && updates_moving(u.status) && now - u.animated >= kAnimation) { - u.animated = now; + // What moves: the spinners, the bars that cannot measure, a pairing's countdown. + const bool moving = (s.page == PICO4_SETTINGS_UPDATES && updates_moving(up.status)) || + (s.page == PICO4_SETTINGS_CONTROLLERS && k.pairing != 0); + if (visible && moving && now - up.animated >= kAnimation) { + up.animated = now; tab_dirty = true; } + if (front_shown && (k.pairing != 0 || !k.known)) { + front_dirty = true; + } // Once before anyone looks, so that the tab never opens blank. if (tab_dirty && (visible || !drawn)) { drawn = true; - draw_tab(tab_surface, s, texts); + draw_tab(tab_surface, s, texts, now); if (!texture_show(gpu, tab_texture, tab_surface, overlay, tab)) { fprintf(stderr, "overpressure-settings: image not accepted\n"); } tab_dirty = false; } if (front_dirty && front_shown) { - draw_front(front_surface, k, texts); + draw_front(front_surface, s, texts, now); if (!texture_show(gpu, front_texture, front_surface, overlay, front)) { fprintf(stderr, "overpressure-settings: image not accepted\n"); } diff --git a/phoenix/pico4-monado/pico4-headset.svg b/phoenix/pico4-monado/pico4-headset.svg new file mode 100644 index 0000000..2dff223 --- /dev/null +++ b/phoenix/pico4-monado/pico4-headset.svg @@ -0,0 +1,28 @@ + + PICO 4 from the front: a wide shell round a dark glass front, its head ring and its top strap + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/phoenix/pico4-monado/pico4-onboarding.cpp b/phoenix/pico4-monado/pico4-onboarding.cpp index b48bb5d..5df9a0d 100644 --- a/phoenix/pico4-monado/pico4-onboarding.cpp +++ b/phoenix/pico4-monado/pico4-onboarding.cpp @@ -4,25 +4,33 @@ * pico4-onboarding: the first-run setup in the headset (docs/session.md#first-run-setup). * * Steam runs its own setup only on Valve's factory image; on an installed system with no saved - * account it goes to the sign-in. This is the PICO 4's, before the first sign-in, once: Steam's - * welcome, its language (the client restarts in it) and time zone (the system's), Wi-Fi, the - * controllers and the lens distance, in the chosen language: the client's own words where it has - * them, ours otherwise (pico4_setup.h, pico4-onboarding.strings). Finishing or skipping it leaves - * ~/.local/share/pico4/setup-done; after that it exits at once, and overpressure-settings has the - * lenses and the controllers. + * account it goes to the sign-in. This is the PICO 4's, before the first sign-in, once, in the + * overpressure client's look (pico4_ui.hpp) and in the order it can be done: * - * With no controller connected 20 s after the start, the laser cannot reach the panel: the station - * listens for one controller after the other, through the driver's pairing socket - * (pico4_station.h), while the panel says what to press. With one controller connected, its laser - * pairs the other. + * 1. The controllers, hands-free: no laser can point before one is paired, so the station listens + * as soon as the setup shows, for one controller after the other, through the driver's pairing + * socket (pico4_station.h), while the page shows which two buttons to hold (pico4_pair_ui.hpp). + * With one there, its laser may go on with one; with both, the lenses follow by themselves. Both + * paired already: the setup starts at the lenses. + * 2. The lens distance, by the thumbstick (left and right): text may hurt to read before, so a + * pattern that is sharp at the right distance, the distance large, and buttons too large to miss. + * 3. Steam's language (the client restarts in it) and time zone (the system's), Wi-Fi, done; their + * lists scroll with the thumbstick. + * + * In the chosen language: the client's own words where it has them, ours otherwise (pico4_setup.h, + * pico4-onboarding.strings). Finishing it leaves ~/.local/share/pico4/setup-done; after that it + * exits at once, and overpressure-settings has the lenses and the controllers. * * pico4-onboarding [--render DIR [LANGUAGE]] * * --render draws every page into DIR as PNG files, without SteamVR, in LANGUAGE (Steam's name). */ +#include "pico4_lens_panel.h" #include "pico4_onboarding.h" +#include "pico4_pair_ui.hpp" #include "pico4_pairing.h" #include "pico4_panels.hpp" +#include "pico4_ui.hpp" #include #include @@ -34,6 +42,7 @@ namespace { using namespace pico4_overlay; using namespace pico4_panels; +using namespace pico4_ui; volatile sig_atomic_t g_stop; @@ -151,8 +160,8 @@ struct Job struct Setup { bool active = false; //!< the setup's pages are up (once the driver said where the controllers are) - enum pico4_setup_page page = PICO4_SETUP_WELCOME; - int list_page = 0; + enum pico4_setup_page page = PICO4_SETUP_CONTROLLERS; + int first = 0; //!< the list's first row shown (the thumbstick scrolls it) int language = 0; int zone = 0; std::vector nets; @@ -172,10 +181,10 @@ struct Setup int ipd = -1, ipd_target = -1; bool ipd_warning = false; //!< the warning below 62 mm shows (pico4_setup_ipd_gate) bool ipd_confirmed = false; //!< its box is ticked, until the page is entered again - bool pressed_warning = false; + bool ipd_drag = false; //!< the slider is held + double slider_x0 = 0, slider_x1 = 1; //!< the slider's ends, as last drawn std::string message; //!< a page's note (the language's restart, a failure) bool message_error = false; - int pressed_row = -1, pressed_arrow = 0, pressed_ipd = 0, pressed_field = 0; double next_scan = 0; Job language_job, zone_job, scan_job, connect_job, ipd_job, radio_job, forget_job; }; @@ -186,256 +195,310 @@ struct State bool known = false; //!< The driver answered a status. bool left = false, right = false; int pairing = 0; //!< The hand being paired: 1 left, 2 right. + double pairing_at = 0; //!< when the station began to listen int last_hands_free = 0; - bool hands_free = false; //!< Pairing started because no controller was there. + double both_at = 0; //!< when both controllers were first there on the pairing page std::string message; - int pressed = PICO4_TOUR_NONE; + struct pico4_hits hits; //!< the panel's controls, as last drawn + int hover = PICO4_HIT_NONE, pressed = PICO4_HIT_NONE; Setup setup; }; // -- Drawing -------------------------------------------------------------------------------------- -constexpr double kTextX = 60, kTextW = PICO4_TOUR_W - 120; - -void -background(cairo_t *c) +//! The controls, as their boxes register while a page draws (pico4_ui_hits.h). +enum Id { - cairo_set_source_rgb(c, 0.11, 0.12, 0.14); - cairo_paint(c); -} + kBack = 1, + kNext, + kMiddle, //!< Refresh, or Turn on Wi-Fi + kOne, //!< go on with one controller + kField, + kShowPassword, + kLensMinus, + kLensPlus, + kLensSlider, + kLensWarning, + kRow0 = 100, //!< a list's row by its index +}; -//! The page's title on one line: smaller where it would not fit (a network's name in a sentence). -void -title(cairo_t *c, const std::string &text) -{ - cairo_set_source_rgb(c, 1, 1, 1); - double size = 44; - while (size > 30 && pico4_text::draw(c, text, kTextX, 40, kTextW, size, true, pico4_text::kStart, true) > size * 1.5) { - size -= 2; - } - pico4_text::line(c, text, kTextX, 40 + (44 - size) / 2, kTextW, size, true); -} +constexpr double kSide = pico4_ui::kSide; +//! A list's window: four rows between the top bar and the footer. +constexpr int kListRows = 4; +constexpr double kListY = pico4_ui::kTopbarH + 24, kListH = kListRows * pico4_ui::kRowH; +//! Seconds the pairing page shows both controllers before the lenses come. +constexpr double kBothShown = 1.6; -void -button(cairo_t *c, double x, const std::string &label, bool pressed, bool primary) +//! The list's count of rows on the page. +int +list_count(const Setup &u) { - rounded(c, x, PICO4_TOUR_BUTTON_Y, PICO4_TOUR_BUTTON_W, PICO4_TOUR_BUTTON_H, 16); - if (pressed) { - cairo_set_source_rgb(c, 0.20, 0.44, 0.72); - } else if (primary) { - cairo_set_source_rgb(c, 0.16, 0.36, 0.60); - } else { - cairo_set_source_rgb(c, 0.22, 0.24, 0.27); + switch (u.page) { + case PICO4_SETUP_LANGUAGE: return PICO4_SETUP_LANGUAGES; + case PICO4_SETUP_TIMEZONE: return PICO4_SETUP_ZONES; + case PICO4_SETUP_WIFI: // and the hidden network; past the list, none + return u.wifi_on && u.wifi == PICO4_WIFI_LIST ? (int)u.nets.size() + 1 : 0; + default: return 0; } - cairo_fill(c); - cairo_set_source_rgb(c, 1, 1, 1); - const double h = pico4_text::draw(c, label, x + 10, 0, PICO4_TOUR_BUTTON_W - 20, 28, true, pico4_text::kCenter, true); - pico4_text::draw(c, label, x + 10, PICO4_TOUR_BUTTON_Y + (PICO4_TOUR_BUTTON_H - h) / 2, PICO4_TOUR_BUTTON_W - 20, 28, - true, pico4_text::kCenter); } -//! A paragraph from @p y down; returns the next y. -double -paragraph(cairo_t *c, const std::string &text, double y, double size) +//! Whether the input page's text can be sent: a name for a hidden network, a usable password. +bool +entry_ok(const Setup &u) { - return y + pico4_text::draw(c, text, kTextX, y, kTextW, size, false) + size * 0.5; + return u.wifi == PICO4_WIFI_NAME ? u.entry[0] != '\0' : pico4_setup_password_ok(u.entry, u.hidden && !u.secured); } -//! The controllers' state, what to press and the pairing's note, from @p y down. -double -controllers(cairo_t *c, const State &s, const Texts &t, double y) +//! The page's top bar: its title, its step as the line under it, and how its thumbstick works. +void +page_top(cairo_t *c, const Frame &f, const Texts &t, const Setup &u, const std::string &title, const std::string &crumb = "", + int back_id = PICO4_HIT_NONE) { - for (int hand = 1; hand <= 2; hand++) { - const bool on = hand == 1 ? s.left : s.right; - const std::string state = !s.known ? "..." : on ? t.our("controller_connected") - : s.pairing == hand ? t.our("controller_waiting") - : t.our("controller_missing"); - cairo_set_source_rgb(c, on ? 0.55 : 0.95, on ? 0.85 : 0.75, on ? 0.55 : 0.45); - y = paragraph(c, fill(t.our(hand == 1 ? "controller_left" : "controller_right"), state), y, 30); - } - y += 6; - cairo_set_source_rgb(c, 0.85, 0.87, 0.90); - const int pair_hand = pico4_pairing_missing(s.left, s.right); - if (s.pairing != 0) { - y = paragraph(c, t.our(s.pairing == 1 ? "controller_pair_left" : "controller_pair_right"), y, 28); - y = paragraph(c, t.our("controller_pair_how"), y, 28); - } else if (s.left && s.right) { - y = paragraph(c, t.our("controllers_both"), y, 28); - } else if (pair_hand != 0) { - y = paragraph(c, t.our(pair_hand == 1 ? "controller_point_left" : "controller_point_right"), y, 28); - } - return y; + const double progress = (u.page + 1.0) / PICO4_SETUP_PAGES; + const bool list = list_count(u) > kListRows; + const std::string hint = u.page == PICO4_SETUP_IPD ? t.our("thumb_lr") : list ? t.our("thumb_scroll") : ""; + char step[16], pages[16]; + snprintf(step, sizeof(step), "%d", u.page + 1); + snprintf(pages, sizeof(pages), "%d", PICO4_SETUP_PAGES); + topbar(c, f, title, crumb, back_id, hint.empty() ? kIcons : u.page == PICO4_SETUP_IPD ? kStick : kStickV, + hint.empty() ? fill(fill(t.our("step_of"), step), pages) : hint, progress); } +//! A list row's frame: chosen, hovered, the line above it; its box registered. void -note(cairo_t *c, const std::string &text, bool error) +list_row(cairo_t *c, const Frame &f, int index, double y, bool chosen, bool first_shown) { - if (text.empty()) { - return; + const int id = kRow0 + index; + const double x = kSide, w = PICO4_TOUR_W - 2 * kSide; + if (chosen) { + set(c, kSelected); + cairo_rectangle(c, x, y, w, kRowH); + cairo_fill(c); + } else if (f.hover == id || f.pressed == id) { + set(c, kHover); + cairo_rectangle(c, x, y, w, kRowH); + cairo_fill(c); } - if (error) { - cairo_set_source_rgb(c, 0.95, 0.55, 0.45); - } else { - cairo_set_source_rgb(c, 0.60, 0.80, 0.95); + if (!first_shown) { + row_line(c, x + 32, y, w - 64); } - pico4_text::line(c, text, kTextX, 440, kTextW, 24, false); + pico4_hits_add(f.hits, id, x, y, w, kRowH); } -//! The list's count of rows on @p page. -int -list_count(const Setup &u) +//! Signal bars (0-4) whose right end is @p right, centred on @p mid. +double +signal_bars(cairo_t *c, double right, double mid, int bars) { - switch (u.page) { - case PICO4_SETUP_LANGUAGE: return PICO4_SETUP_LANGUAGES; - case PICO4_SETUP_TIMEZONE: return PICO4_SETUP_ZONES; - case PICO4_SETUP_WIFI: // and the hidden network; past the list, none - return u.wifi_on && u.wifi == PICO4_WIFI_LIST ? (int)u.nets.size() + 1 : 0; - default: return 0; + const double w = 4 * 7 - 2, x = right - w; + for (int b = 0; b < 4; b++) { + const double h = 6 + b * 5; + pico4_overlay::rounded(c, x + b * 7, mid + 11 - h, 5, h, 1.5); + set(c, kMuted, b < bars ? 1 : 0.35); + cairo_fill(c); } + return w; } +//! The list pages: languages, time zones, networks, in a group the thumbstick scrolls. void -arrows(cairo_t *c, const Setup &u, int count) +draw_list(cairo_t *c, const Frame &f, const State &s, const Texts &t) { - const int pages = pico4_setup_list_pages(count); - if (pages <= 1) { - return; - } - const double down_y = PICO4_SETUP_LIST_Y + PICO4_SETUP_ROWS * PICO4_SETUP_ROW_H - PICO4_SETUP_ARROW_H; - for (int d : {-1, 1}) { - const bool can = d < 0 ? u.list_page > 0 : u.list_page < pages - 1; - const double y = d < 0 ? PICO4_SETUP_LIST_Y : down_y; - rounded(c, PICO4_SETUP_ARROW_X, y, PICO4_SETUP_ARROW_W, PICO4_SETUP_ARROW_H, 14); - if (u.pressed_arrow == d) { - cairo_set_source_rgb(c, 0.20, 0.44, 0.72); + const Setup &u = s.setup; + const int count = list_count(u); + const double x = kSide, w = PICO4_TOUR_W - 2 * kSide; + group(c, x, kListY, w, kListH); + cairo_save(c); + pico4_overlay::rounded(c, x, kListY, w, kListH, kGroupR); + cairo_clip(c); + pico4_hits_clip(f.hits, kListY, kListY + kListH); + for (int r = 0; r < kListRows && u.first + r < count; r++) { + const int i = u.first + r; + const double y = kListY + r * kRowH, mid = y + kRowH / 2, text_x = x + 32; + double right = x + w - 40; + if (u.page == PICO4_SETUP_LANGUAGE) { + const pico4_setup_language &l = pico4_setup_languages[i]; + const std::string own = t.language_text(l.steam, "Language_Name", l.english); + list_row(c, f, i, y, i == u.language, r == 0); + if (i == u.language) { + icon(c, kCheck, right - 28, mid - 14, 28, kBlue); + right -= 44; + } + if (own != l.english) { + const double ew = std::min(text_width(c, l.english, kSmall, false), 300.0); + line_mid(c, l.english, right - ew, mid, ew + 2, kSmall, false, kMuted); + right -= ew + 20; + } + line_mid(c, own, text_x, mid, right - text_x, kBody, true, kText); + } else if (u.page == PICO4_SETUP_TIMEZONE) { + const pico4_setup_zone &z = pico4_setup_zones[i]; + char offset[16]; + pico4_setup_offset_text(z.offset, offset, sizeof(offset)); + const std::string region = t.steam_text((std::string("TimeZoneRegion_") + z.region).c_str(), z.zone); + const std::string cities = t.steam_text((std::string("TimeZoneCities_") + z.cities).c_str(), ""); + list_row(c, f, i, y, i == u.zone, r == 0); + if (i == u.zone) { + icon(c, kCheck, right - 28, mid - 14, 28, kBlue); + right -= 44; + } + const double ow = text_width(c, offset, kSmall, false); + line_mid(c, offset, right - ow, mid, ow + 2, kSmall, false, kMuted); + right -= ow + 24; + line_mid(c, region, text_x, cities.empty() ? mid : mid - 14, right - text_x, kBody, true, kText); + if (!cities.empty()) { + line_mid(c, cities, text_x, mid + 18, right - text_x, kSmall - 2, false, kMuted); + } + } else if (i == (int)u.nets.size()) { + list_row(c, f, i, y, false, r == 0); + line_mid(c, t.steam_text("Settings_Internet_Hidden_Network", "Hidden Network"), text_x, mid, right - text_x, kBody, + false, kMuted); } else { - cairo_set_source_rgb(c, 0.22, 0.24, 0.27); + const pico4_setup_network &n = u.nets[(size_t)i]; + list_row(c, f, i, y, n.active, r == 0); + if (n.secured) { + icon(c, kLock, right - 24, mid - 12, 24, kMuted); + right -= 40; + } + right -= signal_bars(c, right, mid, pico4_setup_bars(n.signal)) + 20; + if (n.active) { + right -= pill(c, t.steam_text("Login_Welcome_Connected", "Connected"), right, mid, kGood, true) + 20; + } + line_mid(c, n.ssid, text_x, mid, right - text_x, kBody, true, kText); } - cairo_fill(c); - cairo_set_source_rgba(c, 1, 1, 1, can ? 1 : 0.3); - const double cx = PICO4_SETUP_ARROW_X + PICO4_SETUP_ARROW_W / 2, cy = y + PICO4_SETUP_ARROW_H / 2; - cairo_move_to(c, cx - 18, cy - 9 * d); - cairo_line_to(c, cx + 18, cy - 9 * d); - cairo_line_to(c, cx, cy + 12 * d); - cairo_close_path(c); - cairo_fill(c); } - char text[32]; - snprintf(text, sizeof(text), "%d / %d", u.list_page + 1, pages); - cairo_set_source_rgb(c, 0.65, 0.67, 0.70); - pico4_text::draw(c, text, PICO4_SETUP_ARROW_X - 10, PICO4_SETUP_LIST_Y + 160, PICO4_SETUP_ARROW_W + 20, 20, false, - pico4_text::kCenter); + pico4_hits_clip(f.hits, -1e9, 1e9); + cairo_restore(c); + scroll_track(c, x + w - 16, kListY + 10, kListH - 20, u.first, kListRows, count); } -//! Signal bars (0-4) at (@p x, @p y): four rising bars, the strong ones lit. +//! The footer's buttons: Back on the left, the page's main button on the right, a middle one when given. void -signal_bars(cairo_t *c, double x, double y, int bars) +footer_buttons(cairo_t *c, const Frame &f, const Texts &t, const std::string &next, Icon next_icon, bool next_ok, + const std::string &middle = "", Icon middle_icon = kIcons, bool back = true) { - for (int b = 0; b < 4; b++) { - const double h = 6 + b * 5; - cairo_rectangle(c, x + b * 8, y + 22 - h, 5, h); - cairo_set_source_rgba(c, 1, 1, 1, b < bars ? 0.95 : 0.25); - cairo_fill(c); + footer(c, f); + const double y = footer_y(f); + double x = kSide; + if (back) { + x += button(c, f, kBack, x, y, 0, t.steam_text("Button_Back", "Back"), kSecondary, kLeft) + 16; } + if (!middle.empty()) { + button(c, f, kMiddle, x, y, 0, middle, kGhost, middle_icon); + } + const double nw = text_width(c, next, kButtonText, true) + 28 + 12 + 64; + button(c, f, kNext, f.w - kSide - std::max(nw, 220.0), y, std::max(nw, 220.0), next, kPrimaryKind, kIcons, next_icon, next_ok); } -//! A padlock at (@p x, @p y), for a network that asks for a password. +//! A note in the content's room under the list (or the page's words): a failure in red. void -padlock(cairo_t *c, double x, double y) +note(cairo_t *c, const std::string &text, bool error, double y) { - cairo_set_source_rgba(c, 1, 1, 1, 0.85); - cairo_set_line_width(c, 2.5); - cairo_arc_negative(c, x + 8, y + 9, 5, 0, M_PI); - cairo_stroke(c); - rounded(c, x, y + 9, 16, 12, 2); - cairo_fill(c); + if (text.empty()) { + return; + } + set(c, error ? kBadText : kMuted); + pico4_text::line(c, text, kSide + 8, y, PICO4_TOUR_W - 2 * kSide - 16, kSmall, false); } -/*! - * One list row: highlighted when chosen, its main text, under it a smaller @p sub line, at the - * right a smaller @p side text, and for a network its signal and its lock. - */ +//! The first page: pairing, hands-free; with one controller there, its laser may go on with one. void -row(cairo_t *c, int r, const std::string &main, const std::string &sub, const std::string &side, bool chosen, - bool pressed, int bars = -1, bool lock = false) +draw_controllers(cairo_t *c, const Frame &f, const State &s, const Texts &t) { - const double y = PICO4_SETUP_LIST_Y + r * PICO4_SETUP_ROW_H; - rounded(c, PICO4_SETUP_LIST_X, y + 3, PICO4_SETUP_LIST_W, PICO4_SETUP_ROW_H - 6, 10); - if (pressed) { - cairo_set_source_rgb(c, 0.20, 0.44, 0.72); - } else if (chosen) { - cairo_set_source_rgb(c, 0.16, 0.36, 0.60); - } else { - cairo_set_source_rgb(c, 0.17, 0.18, 0.21); - } - cairo_fill(c); - double right = PICO4_SETUP_LIST_X + PICO4_SETUP_LIST_W - 16; - if (lock) { - right -= 16; - padlock(c, right, y + 17); - right -= 12; - } - if (bars >= 0) { - right -= 29; - signal_bars(c, right, y + 16, bars); - right -= 12; - } - const double side_w = side.empty() ? 0 : 260; - if (!side.empty()) { - cairo_set_source_rgb(c, 0.75, 0.78, 0.82); - pico4_text::line(c, side, right - side_w, y + 19, side_w, 19, false, false); - } - const double x = PICO4_SETUP_LIST_X + 20, w = right - side_w - 10 - x; - cairo_set_source_rgb(c, 1, 1, 1); - if (sub.empty()) { - pico4_text::line(c, main, x, y + 14, w, 25, chosen, false); - } else { - pico4_text::line(c, main, x, y + 6, w, 23, chosen, false); - cairo_set_source_rgb(c, 0.75, 0.78, 0.82); - pico4_text::line(c, sub, x, y + 34, w, 17, false, false); + const Setup &u = s.setup; + pico4_pair_ui::Pairing p; + p.known = s.known; + p.left = s.left; + p.right = s.right; + p.pairing = s.pairing; + p.listen_left = std::max(0.0, PICO4_PAIRING_LISTEN_S - (f.now - s.pairing_at)); + p.message = s.message; + topbar(c, f, t.our("controllers_title"), "", PICO4_HIT_NONE, kIcons, "", (u.page + 1.0) / PICO4_SETUP_PAGES); + pico4_pair_ui::hand_pills(c, f, t, p); + const bool one = (s.left || s.right) && !(s.left && s.right); + pico4_pair_ui::content(c, f, t, p, one, true); + if (one) { + footer(c, f); + const double y = footer_y(f), mid = y + kButtonH / 2; + icon(c, kController, kSide, mid - 14, 28, kMuted); + line_mid(c, t.our(s.left ? "pair_can_point_left" : "pair_can_point_right"), kSide + 40, mid, 520, kSmall, false, kMuted); + const std::string label = t.our("continue_one"); + const double bw = text_width(c, label, kButtonText, true) + 28 + 12 + 64; + button(c, f, kNext, f.w - kSide - bw, y, bw, label, kGhost, kIcons, kRight); } } -//! Whether the input page's text can be sent: a name for a hidden network, a usable password. -bool -entry_ok(const Setup &u) -{ - return u.wifi == PICO4_WIFI_NAME ? u.entry[0] != '\0' : pico4_setup_password_ok(u.entry, u.hidden && !u.secured); -} - -//! The attempt's sign, centred at (@p x, @p y): a turning arc while joining, a tick, or a cross. +//! The lens distance: a pattern that is sharp at the right distance, the distance large, −, the slider, +. void -join_sign(cairo_t *c, enum pico4_setup_wifi_step step, double x, double y, double since) +draw_ipd(cairo_t *c, const Frame &f, State &s, const Texts &t) { - cairo_new_path(c); // no line from where the text before ended - cairo_set_line_width(c, 9); - cairo_set_line_cap(c, CAIRO_LINE_CAP_ROUND); - if (step == PICO4_WIFI_JOINING) { - cairo_set_source_rgba(c, 1, 1, 1, 0.15); - cairo_arc(c, x, y, 44, 0, 2 * M_PI); - cairo_stroke(c); - const double a = std::fmod(since * 1.6, 1.0) * 2 * M_PI; // a turn in 0.6 s - cairo_set_source_rgb(c, 0.40, 0.65, 0.95); - cairo_arc(c, x, y, 44, a, a + 1.6); - cairo_stroke(c); - return; + Setup &u = s.setup; + page_top(c, f, t, u, t.our("setup_ipd_title")); + // A Siemens star: its black and white wedges blur together while the lenses are not set. + const double sx = kSide, sy = kTopbarH + 32, ss = 300, cx = sx + ss / 2, cy = sy + ss / 2; + cairo_save(c); + pico4_overlay::rounded(c, sx, sy, ss, ss, 24); + cairo_clip(c); + cairo_set_source_rgb(c, 1, 1, 1); + cairo_paint(c); + cairo_set_source_rgb(c, 0, 0, 0); + for (int i = 0; i < 36; i++) { + const double a = 2 * M_PI * i / 36, b = 2 * M_PI * (i + 0.5) / 36; + cairo_move_to(c, cx, cy); + cairo_arc(c, cx, cy, ss * 0.75, a, b); + cairo_close_path(c); + } + cairo_fill(c); + cairo_restore(c); + // The distance, the room for the warning, the controls. + const double x = sx + ss + 48, w = PICO4_TOUR_W - kSide - x; + const int shown = u.ipd_target >= 0 ? u.ipd_target : u.ipd; + char mm[32]; + if (shown >= 0) { + snprintf(mm, sizeof(mm), "%d.%d", shown / 100, shown % 100 / 10); + } else { + snprintf(mm, sizeof(mm), "\xE2\x80\xA6"); } - const bool ok = step == PICO4_WIFI_JOINED; - cairo_set_source_rgb(c, ok ? 0.45 : 0.90, ok ? 0.80 : 0.40, ok ? 0.50 : 0.35); - cairo_arc(c, x, y, 44, 0, 2 * M_PI); - cairo_stroke(c); - cairo_new_path(c); - if (ok) { - cairo_move_to(c, x - 20, y + 2); - cairo_line_to(c, x - 5, y + 17); - cairo_line_to(c, x + 22, y - 14); + set(c, shown >= 0 && shown < PICO4_SETUP_IPD_CLOSE ? kOrange : kText); + pico4_text::line(c, mm, x, sy - 6, 320, 96, true); + set(c, kMuted); + pico4_text::line(c, "mm", x + text_width(c, mm, 96, true) + 12, sy + 46, 80, 36, false); + const double slot_y = sy + 116, slot_h = 140; + if (u.ipd_warning) { + const bool hover = f.hover == kLensWarning || f.pressed == kLensWarning; + fill_box(c, x, slot_y, w, slot_h, 16, kWarnBg); + pico4_overlay::rounded(c, x + 0.5, slot_y + 0.5, w - 1, slot_h - 1, 16); + set(c, hover ? kWarnHeading : kWarnLine); + cairo_set_line_width(c, hover ? 2 : 1); + cairo_stroke(c); + set(c, kWarnText); + pico4_text::draw(c, t.our("lens_close_short"), x + 20, slot_y + 12, w - 40, kSmall, false); + tick_box(c, x + 20, slot_y + slot_h - 50, 34, u.ipd_confirmed, kWarnHeading); + line_mid(c, t.our("lens_closer"), x + 68, slot_y + slot_h - 33, w - 90, kSmall, true, kWarnHeading); + pico4_hits_add(f.hits, kLensWarning, x, slot_y, w, slot_h); } else { - cairo_move_to(c, x - 16, y - 16); - cairo_line_to(c, x + 16, y + 16); - cairo_move_to(c, x + 16, y - 16); - cairo_line_to(c, x - 16, y + 16); + set(c, kMuted); + pico4_text::draw(c, t.our("setup_ipd_text"), x, slot_y + 20, w, kBody, false); + } + const double ry = slot_y + slot_h + 16; + button(c, f, kLensMinus, x, ry, kButtonH, "", kSecondary, kMinus); + button(c, f, kLensPlus, x + w - kButtonH, ry, kButtonH, "", kSecondary, kPlus); + u.slider_x0 = x + kButtonH + 32; + u.slider_x1 = x + w - kButtonH - 32; + const double mid = ry + kButtonH / 2, sw = u.slider_x1 - u.slider_x0; + fill_box(c, u.slider_x0, mid - 4, sw, 8, 4, kTrack); + fill_box(c, u.slider_x0, mid + 10, pico4_panel_slider_x(PICO4_PANEL_MM_CLOSE, u.slider_x0, u.slider_x1) - u.slider_x0, 4, 2, + kOrange); + if (shown >= 0) { + const double knob = pico4_panel_slider_x(shown / 100.0, u.slider_x0, u.slider_x1); + fill_box(c, u.slider_x0, mid - 4, knob - u.slider_x0, 8, 4, kBlue); + cairo_arc(c, knob, mid, f.hover == kLensSlider || u.ipd_drag ? 23 : 20, 0, 2 * M_PI); + set(c, kWhite); + cairo_fill(c); } - cairo_stroke(c); + pico4_hits_add(f.hits, kLensSlider, u.slider_x0 - 20, ry, sw + 40, kButtonH); + footer(c, f); + const std::string label = t.our("looks_sharp"); + const double bw = text_width(c, label, kButtonText, true) + 28 + 12 + 64; + button(c, f, kNext, f.w - kSide - bw, footer_y(f), bw, label, kPrimaryKind, kCheck); } /*! @@ -443,32 +506,28 @@ join_sign(cairo_t *c, enum pico4_setup_wifi_step step, double x, double y, doubl * SteamVR's keyboard; the attempt, with its sign and Steam's words for its end. */ void -draw_wifi_step(cairo_t *c, const State &s, const Texts &t, double now) +draw_wifi_step(cairo_t *c, const Frame &f, const State &s, const Texts &t) { const Setup &u = s.setup; - std::string back = t.steam_text("Button_Back", "Back"), next; + const std::string wifi = t.steam_text("Settings_Internet_WiFi", "Wi-Fi"); if (u.wifi == PICO4_WIFI_NAME || u.wifi == PICO4_WIFI_PASSWORD) { const bool name = u.wifi == PICO4_WIFI_NAME; - title(c, name ? t.steam_text("Settings_Internet_Enter_Network_Credentials", "Enter your network information") - : fill(t.steam_text(u.retry ? "Settings_Internet_Reenter_The_Password_For_Network" - : "Settings_Internet_Enter_The_Password_For_Network", - u.retry ? "Re-enter password for %1$s" : "Enter password for %1$s"), - u.ssid)); - cairo_set_source_rgb(c, 0.75, 0.78, 0.82); - pico4_text::line(c, - name ? t.steam_text("Settings_Internet_Enter_NetworkName", "Network Name") - : t.steam_text("Settings_Internet_Enter_Password", "Password"), - PICO4_SETUP_FIELD_X, PICO4_SETUP_FIELD_Y - 36, PICO4_SETUP_FIELD_W, 22, false); - rounded(c, PICO4_SETUP_FIELD_X, PICO4_SETUP_FIELD_Y, PICO4_SETUP_FIELD_W, PICO4_SETUP_FIELD_H, 12); - cairo_set_source_rgb(c, 0.07, 0.08, 0.09); - cairo_fill_preserve(c); - if (u.keyboard || u.pressed_field == 1) { - cairo_set_source_rgb(c, 0.40, 0.65, 0.95); - } else { - cairo_set_source_rgb(c, 0.35, 0.37, 0.40); - } - cairo_set_line_width(c, 3); + page_top(c, f, t, u, name ? t.steam_text("Settings_Internet_Hidden_Network", "Hidden Network") : u.ssid, wifi, kBack); + const double x = kSide + 80, w = PICO4_TOUR_W - 2 * x, fy = kTopbarH + 96, fh = 76; + group_label(c, + name ? t.steam_text("Settings_Internet_Enter_NetworkName", "Network Name") + : t.steam_text("Settings_Internet_Enter_Password", "Password"), + x, fy - 36, w); + const bool focus = u.keyboard || f.hover == kField || f.pressed == kField; + fill_box(c, x, fy, w, fh, 14, kInset); + pico4_overlay::rounded(c, x + 0.5, fy + 0.5, w - 1, fh - 1, 14); + set(c, focus ? kBlue : kLine); + cairo_set_line_width(c, focus ? 2 : 1); cairo_stroke(c); + if (focus) { + hover_ring(c, x, fy, w, fh, 14); + } + pico4_hits_add(f.hits, kField, x, fy, w, fh); std::string shown = u.entry; if (!name && !u.reveal) { shown.clear(); @@ -476,58 +535,47 @@ draw_wifi_step(cairo_t *c, const State &s, const Texts &t, double now) shown += "\xE2\x97\x8F"; // a dot for each character } } - const double tx = PICO4_SETUP_FIELD_X + 24, tw = PICO4_SETUP_FIELD_W - 48, ty = PICO4_SETUP_FIELD_Y + 22; - cairo_set_source_rgb(c, 1, 1, 1); - const double w = shown.empty() ? 0 : pico4_text::field(c, shown, tx, ty, tw, 30); - if (u.keyboard && std::fmod(now, 1.0) < 0.6) { + const double tx = x + 24, tw = w - 48 - (name ? 0 : 56); + set(c, kText); + const double drawn = shown.empty() ? 0 : pico4_text::field(c, shown, tx, fy + 20, tw, 28); + if (u.keyboard && std::fmod(f.now, 1.0) < 0.6) { // The caret, blinking while the keyboard is up. - cairo_rectangle(c, tx + w + 3, PICO4_SETUP_FIELD_Y + 18, 3, PICO4_SETUP_FIELD_H - 36); + cairo_rectangle(c, tx + drawn + 3, fy + 18, 3, fh - 36); cairo_fill(c); } if (!name) { - // The show-password switch: a box, ticked when the password shows. - const double bx = PICO4_SETUP_FIELD_X, by = PICO4_SETUP_SHOW_Y + 10; - rounded(c, bx, by, 30, 30, 6); - cairo_set_source_rgb(c, u.pressed_field == 2 ? 0.20 : 0.22, u.pressed_field == 2 ? 0.44 : 0.24, - u.pressed_field == 2 ? 0.72 : 0.27); - cairo_fill(c); - if (u.reveal) { - cairo_set_source_rgb(c, 1, 1, 1); - cairo_set_line_width(c, 4); - cairo_move_to(c, bx + 7, by + 15); - cairo_line_to(c, bx + 13, by + 22); - cairo_line_to(c, bx + 24, by + 8); - cairo_stroke(c); - } - cairo_set_source_rgb(c, 0.85, 0.87, 0.90); - pico4_text::line(c, t.steam_text("Login_ShowPassword", "Show Password"), bx + 44, by + 3, - PICO4_SETUP_SHOW_W - 44, 22, false); - } - if (u.retry && !name) { - note(c, t.steam_text("Login_PasswordMismatch", "Incorrect Password"), true); - } - next = t.steam_text("Settings_Internet_Connect", "Connect"); - if (name) { - next = t.steam_text("Button_Continue", "Continue"); - } - button(c, PICO4_TOUR_SKIP_X, back, s.pressed == PICO4_TOUR_SKIP, false); - button(c, PICO4_TOUR_NEXT_X, next, s.pressed == PICO4_TOUR_NEXT, entry_ok(u)); + // Show the password: the eye in the field. + const bool hover = f.hover == kShowPassword || f.pressed == kShowPassword; + icon(c, kEye, x + w - 56, fy + (fh - 30) / 2, 30, u.reveal || hover ? kText : kMuted); + pico4_hits_add(f.hits, kShowPassword, x + w - 72, fy, 72, fh); + } + set(c, u.retry && !name ? kBadText : kMuted); + pico4_text::draw(c, u.retry && !name ? t.steam_text("Login_PasswordMismatch", "Incorrect Password") : t.our("setup_wifi_later"), + x + 4, fy + fh + 18, w - 8, kSmall, false); + footer_buttons(c, f, t, + name ? t.steam_text("Button_Continue", "Continue") : t.steam_text("Settings_Internet_Connect", "Connect"), + name ? kRight : kIcons, entry_ok(u)); return; } - title(c, u.ssid); - join_sign(c, u.wifi, PICO4_TOUR_W / 2.0, 230, now - u.step_at); + page_top(c, f, t, u, u.ssid, wifi, u.wifi == PICO4_WIFI_FAILED ? kBack : PICO4_HIT_NONE); + const double cx = PICO4_TOUR_W / 2.0, cy = kTopbarH + 120; std::string text; switch (u.wifi) { case PICO4_WIFI_JOINING: + spinner(c, cx, cy, 40, f.now - u.step_at); text = fill(t.steam_text("Settings_Internet_Connecting_To_Network", "Connecting to %1$s..."), u.ssid); break; - case PICO4_WIFI_JOINED: text = t.steam_text("Settings_Internet_Connection_Successful", "Connection successful!"); break; + case PICO4_WIFI_JOINED: + chip(c, kCheck, cx - 52, cy - 52, 104, kGoodBg, kGoodText, true); + text = t.steam_text("Settings_Internet_Connection_Successful", "Connection successful!"); + break; default: + chip(c, kAlert, cx - 52, cy - 52, 104, kBadBg, kBadText, true); text = t.steam_text("Settings_Internet_Failed_To_Connect", "Failed to Connect"); break; } - cairo_set_source_rgb(c, 1, 1, 1); - pico4_text::draw(c, text, kTextX, 310, kTextW, 30, true, pico4_text::kCenter); + set(c, kText); + pico4_text::draw(c, text, kSide, cy + 84, PICO4_TOUR_W - 2 * kSide, 32, true, pico4_text::kCenter); if (u.wifi != PICO4_WIFI_FAILED) { return; } @@ -537,156 +585,86 @@ draw_wifi_step(cairo_t *c, const State &s, const Texts &t, double now) : u.join == PICO4_JOIN_NOT_FOUND ? fill(t.steam_text("Settings_Internet_Network_Not_Found", "Network not found: %1$s"), u.ssid) : t.steam_text("Settings_Internet_Failed_To_Connect_To_Network", "Failed to connect to the network."); - cairo_set_source_rgb(c, 0.95, 0.55, 0.45); - pico4_text::draw(c, why, kTextX, 360, kTextW, 26, false, pico4_text::kCenter); - button(c, PICO4_TOUR_SKIP_X, back, s.pressed == PICO4_TOUR_SKIP, false); - button(c, PICO4_TOUR_NEXT_X, t.steam_text("Button_TryAgain", "Try Again"), s.pressed == PICO4_TOUR_NEXT, true); + set(c, kBadText); + pico4_text::draw(c, why, kSide, cy + 136, PICO4_TOUR_W - 2 * kSide, kSmall, false, pico4_text::kCenter); + footer_buttons(c, f, t, t.steam_text("Button_TryAgain", "Try Again"), kRefresh, true); } void -draw_setup(cairo_t *c, const State &s, const Texts &t, double now) +draw_setup(cairo_t *c, const Frame &f, State &s, const Texts &t) { - const Setup &u = s.setup; + Setup &u = s.setup; + if (u.page == PICO4_SETUP_CONTROLLERS) { + draw_controllers(c, f, s, t); + return; + } + if (u.page == PICO4_SETUP_IPD) { + draw_ipd(c, f, s, t); + return; + } if (u.page == PICO4_SETUP_WIFI && u.wifi != PICO4_WIFI_LIST) { - draw_wifi_step(c, s, t, now); + draw_wifi_step(c, f, s, t); return; } - const int first = u.list_page * PICO4_SETUP_ROWS; - const int count = list_count(u); - std::string middle; + const double note_y = kListY + kListH + 16; switch (u.page) { - case PICO4_SETUP_WELCOME: { - title(c, t.language_text(t.language.c_str(), "Steam_Welcome", "Welcome")); - cairo_set_source_rgb(c, 0.85, 0.87, 0.90); - double y = paragraph(c, t.our("setup_welcome"), 130, 28); - y = controllers(c, s, t, y + 6); - if (s.left || s.right) { - cairo_set_source_rgb(c, 0.85, 0.87, 0.90); - paragraph(c, t.our("setup_welcome_point"), y, 26); - } - break; - } case PICO4_SETUP_LANGUAGE: - title(c, t.language_text(t.language.c_str(), "Steam_Language_Selection_Label", "Select a language")); - for (int r = 0; r < PICO4_SETUP_ROWS && first + r < count; r++) { - const pico4_setup_language &l = pico4_setup_languages[first + r]; - const std::string own = t.language_text(l.steam, "Language_Name", l.english); - row(c, r, own, "", own == l.english ? "" : l.english, first + r == u.language, u.pressed_row == r); - } + page_top(c, f, t, u, t.language_text(t.language.c_str(), "Steam_Language_Selection_Label", "Select a language")); + draw_list(c, f, s, t); + note(c, !s.message.empty() ? s.message : !u.message.empty() ? u.message : t.our("setup_language_note"), + !s.message.empty() || u.message_error, note_y); + footer_buttons(c, f, t, t.steam_text("Button_Continue", "Continue"), kRight, true); break; case PICO4_SETUP_TIMEZONE: - title(c, t.steam_text("Settings_TimeAndDate_ChooseTimezone_OOBE", "Choose your timezone")); - for (int r = 0; r < PICO4_SETUP_ROWS && first + r < count; r++) { - const pico4_setup_zone &z = pico4_setup_zones[first + r]; - char offset[16]; - pico4_setup_offset_text(z.offset, offset, sizeof(offset)); - const std::string region = t.steam_text((std::string("TimeZoneRegion_") + z.region).c_str(), z.zone); - const std::string cities = t.steam_text((std::string("TimeZoneCities_") + z.cities).c_str(), ""); - row(c, r, region, std::string(offset) + (cities.empty() ? "" : " \xC2\xB7 " + cities), "", first + r == u.zone, - u.pressed_row == r); - } + page_top(c, f, t, u, t.steam_text("Settings_TimeAndDate_ChooseTimezone_OOBE", "Choose your timezone")); + draw_list(c, f, s, t); + note(c, !u.message.empty() ? u.message : t.our("setup_timezone_note"), u.message_error, note_y); + footer_buttons(c, f, t, t.steam_text("Button_Continue", "Continue"), kRight, true); break; case PICO4_SETUP_WIFI: - title(c, t.steam_text("Login_Welcome_ChooseYourNetwork", "Choose your network")); - middle = u.wifi_on ? t.steam_text("Settings_Internet_Refresh", "Refresh") : t.our("setup_wifi_on"); + page_top(c, f, t, u, t.steam_text("Login_Welcome_ChooseYourNetwork", "Choose your network")); if (!u.wifi_on) { - cairo_set_source_rgb(c, 0.85, 0.87, 0.90); - paragraph(c, t.our("setup_wifi_off"), 140, 28); - break; - } - if (u.scanned && u.nets.empty() && u.list_page == 0) { - cairo_set_source_rgb(c, 0.85, 0.87, 0.90); - pico4_text::line(c, t.steam_text("Login_NoNetworksFound", "No networks found"), PICO4_SETUP_LIST_X + 20, - PICO4_SETUP_LIST_Y + PICO4_SETUP_ROW_H + 11, PICO4_SETUP_LIST_W, 26, false); - } - for (int r = 0; r < PICO4_SETUP_ROWS && first + r < count; r++) { - const int i = first + r; - if (i == (int)u.nets.size()) { - row(c, r, t.steam_text("Settings_Internet_Hidden_Network", "Hidden Network"), "", "", false, - u.pressed_row == r); - continue; - } - const pico4_setup_network &n = u.nets[(size_t)i]; - const std::string side = n.active ? t.steam_text("Login_Welcome_Connected", "Connected") : ""; - row(c, r, n.ssid, "", side, n.active, u.pressed_row == r, pico4_setup_bars(n.signal), n.secured); - } - break; - case PICO4_SETUP_CONTROLLERS: - title(c, t.our("controllers_title")); - controllers(c, s, t, 130); - if (pico4_pairing_missing(s.left, s.right) != 0 && s.pairing == 0) { - middle = t.our("pair"); - } - break; - case PICO4_SETUP_IPD: { - title(c, t.our("setup_ipd_title")); - cairo_set_source_rgb(c, 0.85, 0.87, 0.90); - paragraph(c, t.our("setup_ipd_text"), 120, 26); - for (int d : {-1, 1}) { - const double x = d < 0 ? PICO4_SETUP_IPD_LESS_X : PICO4_SETUP_IPD_MORE_X; - rounded(c, x, PICO4_SETUP_IPD_Y, PICO4_SETUP_IPD_W, PICO4_SETUP_IPD_H, 16); - if (u.pressed_ipd == d) { - cairo_set_source_rgb(c, 0.20, 0.44, 0.72); - } else { - cairo_set_source_rgb(c, 0.22, 0.24, 0.27); - } - cairo_fill(c); - cairo_set_source_rgb(c, 1, 1, 1); - pico4_text::draw(c, d < 0 ? "\xE2\x88\x92" : "+", x, PICO4_SETUP_IPD_Y + 22, PICO4_SETUP_IPD_W, 64, true, + chip(c, kWifi, PICO4_TOUR_W / 2.0 - 52, kTopbarH + 64, 104, kSurface, kMuted, true); + set(c, kText); + pico4_text::draw(c, t.our("setup_wifi_off"), kSide, kTopbarH + 200, PICO4_TOUR_W - 2 * kSide, 32, true, pico4_text::kCenter); + footer_buttons(c, f, t, t.steam_text("Button_Continue", "Continue"), kRight, true, t.our("setup_wifi_on"), kWifi); + break; } - char mm[32]; - const int shown = u.ipd_target >= 0 ? u.ipd_target : u.ipd; - if (shown >= 0) { - snprintf(mm, sizeof(mm), "%d.%d mm", shown / 100, shown % 100 / 10); - } else { - snprintf(mm, sizeof(mm), "..."); - } - cairo_set_source_rgb(c, 1, 1, 1); - pico4_text::draw(c, mm, 330, PICO4_SETUP_IPD_Y + 28, 340, 56, true, pico4_text::kCenter); - if (u.ipd_warning) { - close_warning(c, t.our("lens_close_warning"), PICO4_SETUP_WARNING_X, PICO4_SETUP_WARNING_Y, - PICO4_SETUP_WARNING_W, PICO4_SETUP_WARNING_H, u.ipd_confirmed, u.pressed_warning); - } else { - cairo_set_source_rgb(c, 0.65, 0.67, 0.70); - pico4_text::draw(c, t.our("setup_ipd_range"), kTextX, 380, kTextW, 22, false, pico4_text::kCenter); + draw_list(c, f, s, t); + if (u.scanned && u.nets.empty()) { + line_mid(c, t.steam_text("Login_NoNetworksFound", "No networks found"), kSide + 32, kListY + kRowH * 1.5, + PICO4_TOUR_W - 2 * kSide - 64, kBody, false, kMuted); } + note(c, u.wifi_message.empty() ? t.our("setup_wifi_later") : u.wifi_message, false, note_y); + footer_buttons(c, f, t, t.steam_text("Button_Continue", "Continue"), kRight, true, + t.steam_text("Settings_Internet_Refresh", "Refresh"), kRefresh); break; - } - case PICO4_SETUP_READY: - title(c, t.our("setup_ready_title")); - cairo_set_source_rgb(c, 0.85, 0.87, 0.90); - paragraph(c, fill(t.our("setup_ready_text"), t.steam_text("Button_Done", "Done")), 130, 30); + case PICO4_SETUP_READY: { + page_top(c, f, t, u, t.our("setup_ready_title")); + const double cx = PICO4_TOUR_W / 2.0; + chip(c, kCheck, cx - 52, kTopbarH + 48, 104, kGoodBg, kGoodText, true); + set(c, kText); + pico4_text::draw(c, t.our("setup_ready_title"), kSide, kTopbarH + 184, PICO4_TOUR_W - 2 * kSide, kH1, true, + pico4_text::kCenter); + set(c, kMuted); + pico4_text::draw(c, fill(t.our("setup_ready_text"), t.steam_text("Button_Done", "Done")), kSide + 60, kTopbarH + 244, + PICO4_TOUR_W - 2 * kSide - 120, kBody, false, pico4_text::kCenter); + footer_buttons(c, f, t, t.steam_text("Button_Done", "Done"), kPlay, true); break; - case PICO4_SETUP_PAGES: break; - } - arrows(c, u, count); - if (u.page == PICO4_SETUP_WIFI) { - note(c, u.wifi_message.empty() ? t.our("setup_wifi_later") : u.wifi_message, false); - } else if (!s.message.empty()) { - note(c, s.message, true); - } else if (!u.message.empty()) { - note(c, u.message, u.message_error); - } else if (u.page == PICO4_SETUP_TIMEZONE) { - note(c, t.our("setup_timezone_note"), false); } - button(c, PICO4_TOUR_SKIP_X, - u.page == PICO4_SETUP_WELCOME ? t.our("skip") : t.steam_text("Button_Back", "Back"), - s.pressed == PICO4_TOUR_SKIP, false); - if (!middle.empty()) { - button(c, PICO4_TOUR_PAIR_X, middle, s.pressed == PICO4_TOUR_PAIR, false); + default: break; } - button(c, PICO4_TOUR_NEXT_X, - u.page == PICO4_SETUP_READY ? t.steam_text("Button_Done", "Done") : t.steam_text("Button_Continue", "Continue"), - s.pressed == PICO4_TOUR_NEXT, true); } void -draw(cairo_surface_t *surface, const State &s, const Texts &t, double now = 0) +draw(cairo_surface_t *surface, State &s, const Texts &t, double now = 0) { cairo_t *c = cairo_create(surface); - background(c); - draw_setup(c, s, t, now); + pico4_hits_clear(&s.hits); + Frame f{PICO4_TOUR_W, PICO4_TOUR_H, &s.hits, s.hover, s.pressed, now}; + background(c, f); + draw_setup(c, f, s, t); cairo_destroy(c); cairo_surface_flush(surface); } @@ -698,25 +676,30 @@ render(const char *dir, const char *language) t.load(language != nullptr ? language : "english"); cairo_surface_t *surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, PICO4_TOUR_W, PICO4_TOUR_H); int r = 0; - auto save = [&](const State &s, const char *name) { - draw(surface, s, t); + auto save = [&](State &s, const char *name, double now = 0) { + draw(surface, s, t, now); const std::string file = std::string(dir) + "/" + name + ".png"; r |= cairo_surface_write_to_png(surface, file.c_str()) != CAIRO_STATUS_SUCCESS; }; - // The controllers' page as each pairing leaves it: none (listening hands-free), one, both. + // The first page as each pairing leaves it: none (listening for the left), one, both. State s; s.known = true; s.setup.active = true; s.setup.page = PICO4_SETUP_CONTROLLERS; s.pairing = 1; - save(s, "setup-controllers-none"); + s.pairing_at = -21; + save(s, "setup-controllers-none", 0.5); + s.left = true; + s.pairing = 2; + s.hover = kNext; + save(s, "setup-controllers-one", 0.5); + s.hover = PICO4_HIT_NONE; s.pairing = 0; - s.left = s.right = true; + s.right = true; save(s, "setup-controllers-both"); - // The setup's pages, with made-up networks and a lens distance. + // The setup's other pages, with made-up networks and a lens distance. State u; - u.known = true; - u.left = true; + u.known = u.left = u.right = true; u.setup.active = true; u.setup.language = std::max(0, pico4_setup_language_index(t.language.c_str())); u.setup.zone = pico4_setup_zone_index("Europe/Paris"); @@ -724,37 +707,33 @@ render(const char *dir, const char *language) const char *nets = "*:Home:82:WPA2\n :Neighbours:61:WPA2\n :Cafe:35:\n :Office 5G:12:WPA2 WPA3\n"; pico4_setup_network found[8]; u.setup.nets.assign(found, found + pico4_setup_parse_networks(nets, found, 8)); - u.setup.ipd = 6350; - const struct - { - const char *name; - enum pico4_setup_page page; - int list_page; - } setup_pages[] = { - {"setup-welcome", PICO4_SETUP_WELCOME, 0}, {"setup-language", PICO4_SETUP_LANGUAGE, 0}, - {"setup-language-2", PICO4_SETUP_LANGUAGE, 1}, {"setup-timezone", PICO4_SETUP_TIMEZONE, 3}, - {"setup-wifi", PICO4_SETUP_WIFI, 0}, {"setup-controllers", PICO4_SETUP_CONTROLLERS, 0}, - {"setup-ipd", PICO4_SETUP_IPD, 0}, {"setup-ready", PICO4_SETUP_READY, 0}, - }; - for (const auto &p : setup_pages) { - u.setup.page = p.page; - u.setup.list_page = p.list_page; - u.setup.message = p.page == PICO4_SETUP_LANGUAGE ? t.our("setup_language_note") : ""; - save(u, p.name); - } - // The lens page's warning below 62 mm, and with its box ticked. - u.setup.page = PICO4_SETUP_IPD; - u.setup.ipd = 6200; - u.setup.ipd_warning = true; + u.setup.ipd = 6650; + Setup &w = u.setup; + w.page = PICO4_SETUP_IPD; + save(u, "setup-ipd"); + w.ipd = 6200; + w.ipd_warning = true; save(u, "setup-ipd-close"); - u.setup.ipd = 6050; - u.setup.ipd_confirmed = true; + w.ipd = 6050; + w.ipd_confirmed = true; save(u, "setup-ipd-close-ticked"); - u.setup.ipd = 6350; - u.setup.ipd_warning = u.setup.ipd_confirmed = false; - // The Wi-Fi page's steps past its list. - Setup &w = u.setup; + w.ipd = 6350; + w.ipd_warning = w.ipd_confirmed = false; + w.page = PICO4_SETUP_LANGUAGE; + w.first = pico4_list_reveal(0, w.language, kListRows, PICO4_SETUP_LANGUAGES); + u.hover = kRow0 + w.language + 1; + save(u, "setup-language"); + u.hover = PICO4_HIT_NONE; + w.first = 9; + w.message = t.our("setup_language_note"); + save(u, "setup-language-scrolled"); + w.message.clear(); + w.page = PICO4_SETUP_TIMEZONE; + w.first = pico4_list_reveal(0, w.zone, kListRows, PICO4_SETUP_ZONES); + save(u, "setup-timezone"); w.page = PICO4_SETUP_WIFI; + w.first = 0; + save(u, "setup-wifi"); w.wifi_message = t.steam_text("Settings_Internet_Connection_Successful", "Connection successful!"); save(u, "setup-wifi-joined-list"); w.wifi_message.clear(); @@ -762,11 +741,11 @@ render(const char *dir, const char *language) w.secured = true; w.wifi = PICO4_WIFI_PASSWORD; w.keyboard = true; - save(u, "setup-wifi-password-empty"); + save(u, "setup-wifi-password-empty", 0.2); snprintf(w.entry, sizeof(w.entry), "correct horse"); - save(u, "setup-wifi-password"); + save(u, "setup-wifi-password", 0.2); w.reveal = true; - save(u, "setup-wifi-password-shown"); + save(u, "setup-wifi-password-shown", 0.2); w.reveal = false; w.retry = true; w.keyboard = false; @@ -782,8 +761,7 @@ render(const char *dir, const char *language) w.entry[0] = '\0'; w.wifi = PICO4_WIFI_JOINING; w.step_at = 0; - draw(surface, u, t, 0.2); - r |= cairo_surface_write_to_png(surface, (std::string(dir) + "/setup-wifi-joining.png").c_str()) != CAIRO_STATUS_SUCCESS; + save(u, "setup-wifi-joining", 0.2); w.wifi = PICO4_WIFI_JOINED; save(u, "setup-wifi-joined"); w.wifi = PICO4_WIFI_FAILED; @@ -796,6 +774,10 @@ render(const char *dir, const char *language) w.wifi = PICO4_WIFI_LIST; w.wifi_on = false; save(u, "setup-wifi-off"); + w.wifi_on = true; + w.page = PICO4_SETUP_READY; + u.hover = kNext; + save(u, "setup-ready"); cairo_surface_destroy(surface); return r; } @@ -910,6 +892,8 @@ main(int argc, char **argv) overlay->SetOverlayWidthInMeters(front, 1.2f); // The laser reaches the panel outside the dashboard too, and it is drawn over Steam's window. overlay->SetOverlayFlag(front, vr::VROverlayFlags_MakeOverlaysInteractiveIfVisible, true); + // The thumbstick: up and down scroll a list, left and right move the lenses. + overlay->SetOverlayFlag(front, vr::VROverlayFlags_SendVRDiscreteScrollEvents, true); overlay->SetOverlaySortOrder(front, 100); cairo_surface_t *surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, PICO4_TOUR_W, PICO4_TOUR_H); @@ -928,11 +912,11 @@ main(int argc, char **argv) fflush(stdout); State s; + pico4_hits_clear(&s.hits); Setup &u = s.setup; Front placement; Request status, pair; - const double started = now_s(); - double next_status = 0, next_oobe = 0, next_texts = 0, next_view_check = 0, next_frame_draw = 0; + double next_status = 0, next_oobe = 0, next_texts = 0, next_view_check = 0, next_frame_draw = 0, next_pair_try = 0; double systemui_since = 0; //!< when SteamVR's system UI was first seen, 0 before double keyboard_warm_at = 0, keyboard_hide_at = 0; //!< the keyboard's first showing, 0 when done bool view_pending = false; //!< the setup runs; its room view and closed dashboard still to come @@ -973,9 +957,11 @@ main(int argc, char **argv) snprintf(text, sizeof(text), "pair %s %d", hand == 1 ? "left" : "right", PICO4_PAIRING_LISTEN_S); if (pair.start(text)) { s.pairing = hand; + s.pairing_at = now_s(); s.message.clear(); } else { s.message = texts.our("controller_radio"); + next_pair_try = now_s() + 3; } dirty = true; }; @@ -1029,7 +1015,6 @@ main(int argc, char **argv) } u.wifi = step; u.step_at = now_s(); - u.pressed_field = 0; dirty = true; if (typing) { keyboard(true); @@ -1079,18 +1064,19 @@ main(int argc, char **argv) memset(u.entry, 0, sizeof(u.entry)); u.wifi = PICO4_WIFI_LIST; u.page = page; - u.pressed_row = -1; + u.first = 0; u.message.clear(); u.message_error = false; s.message.clear(); + s.hover = s.pressed = PICO4_HIT_NONE; + s.both_at = 0; switch (page) { - case PICO4_SETUP_LANGUAGE: u.list_page = pico4_setup_list_page(u.language); break; + case PICO4_SETUP_LANGUAGE: u.first = pico4_list_reveal(0, u.language, kListRows, PICO4_SETUP_LANGUAGES); break; case PICO4_SETUP_TIMEZONE: u.zone = pico4_setup_zone_index(system_zone().c_str()); - u.list_page = pico4_setup_list_page(u.zone); + u.first = pico4_list_reveal(0, u.zone, kListRows, PICO4_SETUP_ZONES); break; case PICO4_SETUP_WIFI: - u.list_page = 0; u.wifi_message.clear(); if (!u.radio_job.running()) { u.radio_job.start({"nmcli", "-t", "radio", "wifi"}); @@ -1109,56 +1095,34 @@ main(int argc, char **argv) } dirty = true; }; - auto press_setup = [&](int button) { - if (u.page == PICO4_SETUP_WIFI && u.wifi != PICO4_WIFI_LIST) { - // Past the list: Back to it, the main button sends the field or tries again. - if (u.wifi == PICO4_WIFI_JOINING || u.wifi == PICO4_WIFI_JOINED) { - return; - } - if (button == PICO4_TOUR_SKIP) { - wifi_step(PICO4_WIFI_LIST); - scan(false); - } else if (button == PICO4_TOUR_NEXT && u.wifi == PICO4_WIFI_FAILED) { - u.retry = u.join == PICO4_JOIN_PASSWORD; - if (u.secured || u.hidden) { - wifi_step(PICO4_WIFI_PASSWORD); - } else { - connect_network(); - } - } else if (button == PICO4_TOUR_NEXT) { - submit_entry(); - } - dirty = true; + auto lens = [&](int steps) { + if (u.ipd < 0) { return; } - if (button == PICO4_TOUR_SKIP) { - if (u.page == PICO4_SETUP_WELCOME) { - finish(); - } else { - enter(pico4_setup_back(u.page)); - } - } else if (button == PICO4_TOUR_NEXT) { - const enum pico4_setup_page next = pico4_setup_next(u.page); - if (next == PICO4_SETUP_PAGES) { - finish(); - } else { - enter(next); - } - } else if (button == PICO4_TOUR_PAIR) { - if (u.page == PICO4_SETUP_WIFI && !u.wifi_on) { - u.radio_job.start({"nmcli", "radio", "wifi", "on"}); - } else if (u.page == PICO4_SETUP_WIFI) { - scan(true); - } else if (u.page == PICO4_SETUP_CONTROLLERS) { - s.hands_free = false; - start_pairing(pico4_pairing_missing(s.left, s.right)); - } + const int from = u.ipd_target >= 0 ? u.ipd_target : u.ipd; + bool refused; + const int to = pico4_setup_ipd_gate(from, pico4_setup_ipd_step(from, steps), u.ipd_confirmed, &refused); + u.ipd_warning = refused || (u.ipd_warning && to <= PICO4_SETUP_IPD_CLOSE); + if (to != from) { + u.ipd_target = to; + } + dirty = true; + }; + //! The slider at @p x: where the lenses go, through the gate below 62 mm. + auto slide = [&](double x) { + if (u.ipd < 0) { + return; } + const int from = u.ipd_target >= 0 ? u.ipd_target : u.ipd; + const int at = (int)lround(pico4_panel_slider_mm(x, u.slider_x0, u.slider_x1) * 100); + bool refused; + const int to = pico4_setup_ipd_gate(from, pico4_setup_ipd_step(at, 0), u.ipd_confirmed, &refused); + u.ipd_warning = refused || (u.ipd_warning && to <= PICO4_SETUP_IPD_CLOSE); + u.ipd_target = to; dirty = true; }; - auto choose_row = [&](int r) { - const int i = u.list_page * PICO4_SETUP_ROWS + r; - if (i >= list_count(u)) { + auto choose_row = [&](int i) { + if (i < 0 || i >= list_count(u)) { return; } if (u.page == PICO4_SETUP_LANGUAGE && !u.language_job.running()) { @@ -1198,16 +1162,58 @@ main(int argc, char **argv) } dirty = true; }; - auto lens = [&](int steps) { - if (u.ipd < 0) { + //! What a control does once let go on. + auto act = [&](int id) { + if (id >= kRow0) { + choose_row(id - kRow0); return; } - const int from = u.ipd_target >= 0 ? u.ipd_target : u.ipd; - bool refused; - const int to = pico4_setup_ipd_gate(from, pico4_setup_ipd_step(from, steps), u.ipd_confirmed, &refused); - u.ipd_warning = refused || (u.ipd_warning && to <= PICO4_SETUP_IPD_CLOSE); - if (to != from) { - u.ipd_target = to; + if (u.page == PICO4_SETUP_WIFI && u.wifi != PICO4_WIFI_LIST) { + // Past the list: Back to it, the main button sends the field or tries again. + if (id == kField && !u.keyboard) { + keyboard(true); + } else if (id == kShowPassword) { + u.reveal = !u.reveal; + } else if (u.wifi == PICO4_WIFI_JOINING || u.wifi == PICO4_WIFI_JOINED) { + return; + } else if (id == kBack) { + wifi_step(PICO4_WIFI_LIST); + scan(false); + } else if (id == kNext && u.wifi == PICO4_WIFI_FAILED) { + u.retry = u.join == PICO4_JOIN_PASSWORD; + if (u.secured || u.hidden) { + wifi_step(PICO4_WIFI_PASSWORD); + } else { + connect_network(); + } + } else if (id == kNext) { + submit_entry(); + } + dirty = true; + return; + } + switch (id) { + case kBack: enter(pico4_setup_back(u.page)); break; + case kNext: { + const enum pico4_setup_page next = pico4_setup_next(u.page); + if (next == PICO4_SETUP_PAGES) { + finish(); + } else { + enter(next); + } + break; + } + case kMiddle: + if (u.page == PICO4_SETUP_WIFI && !u.wifi_on) { + u.radio_job.start({"nmcli", "radio", "wifi", "on"}); + } else if (u.page == PICO4_SETUP_WIFI) { + scan(true); + } + break; + case kLensMinus: lens(-1); break; + case kLensPlus: lens(1); break; + case kLensWarning: u.ipd_confirmed = !u.ipd_confirmed; break; + default: break; } dirty = true; }; @@ -1251,49 +1257,53 @@ main(int argc, char **argv) continue; } const double x = e.data.mouse.x, y = PICO4_TOUR_H - e.data.mouse.y; // SteamVR's y points up - const bool middle_shown = - (u.page == PICO4_SETUP_WIFI && u.wifi == PICO4_WIFI_LIST) || - (u.page == PICO4_SETUP_CONTROLLERS && s.pairing == 0 && pico4_pairing_missing(s.left, s.right) != 0); - const bool lists = list_count(u) > 0; - if (e.eventType == vr::VREvent_MouseButtonDown) { - s.pressed = pico4_tour_hit(x, y, middle_shown); - u.pressed_row = lists ? pico4_setup_hit_row(x, y) : -1; - u.pressed_arrow = lists ? pico4_setup_hit_arrow(x, y) : 0; - u.pressed_ipd = u.page == PICO4_SETUP_IPD ? pico4_setup_hit_ipd(x, y) : 0; - u.pressed_warning = u.page == PICO4_SETUP_IPD && u.ipd_warning && pico4_setup_hit_warning(x, y); - u.pressed_field = typing ? pico4_setup_hit_field(x, y) : 0; - if (u.pressed_field == 2 && u.wifi != PICO4_WIFI_PASSWORD) { - u.pressed_field = 0; // a name has no switch to show it + switch (e.eventType) { + case vr::VREvent_MouseMove: { + const int at = pico4_hits_at(&s.hits, x, y); + if (at != s.hover) { + s.hover = at; + dirty = true; + } + if (u.ipd_drag) { + slide(x); + } + break; + } + case vr::VREvent_FocusLeave: + s.hover = PICO4_HIT_NONE; + dirty = true; + break; + case vr::VREvent_MouseButtonDown: + s.pressed = s.hover = pico4_hits_at(&s.hits, x, y); + if (s.pressed == kLensSlider) { + u.ipd_drag = true; + slide(x); } dirty = true; - } else if (e.eventType == vr::VREvent_MouseButtonUp) { - const int was = s.pressed, was_row = u.pressed_row, was_arrow = u.pressed_arrow, was_ipd = u.pressed_ipd; - const int was_field = u.pressed_field; - const bool was_warning = u.pressed_warning; - s.pressed = PICO4_TOUR_NONE; - u.pressed_row = -1; - u.pressed_arrow = 0; - u.pressed_ipd = 0; - u.pressed_field = 0; - u.pressed_warning = false; + break; + case vr::VREvent_MouseButtonUp: { + const int was = s.pressed; + s.pressed = PICO4_HIT_NONE; + if (u.ipd_drag) { + u.ipd_drag = false; + } else if (was != PICO4_HIT_NONE && was == pico4_hits_at(&s.hits, x, y)) { + act(was); + } dirty = true; - if (was_warning && u.ipd_warning && pico4_setup_hit_warning(x, y)) { - u.ipd_confirmed = !u.ipd_confirmed; - } else if (was_field != 0 && typing && was_field == pico4_setup_hit_field(x, y)) { - if (was_field == 1 && !u.keyboard) { - keyboard(true); - } else if (was_field == 2) { - u.reveal = !u.reveal; - } - } else if (was != PICO4_TOUR_NONE && was == pico4_tour_hit(x, y, middle_shown)) { - press_setup(was); - } else if (was_row >= 0 && lists && was_row == pico4_setup_hit_row(x, y)) { - choose_row(was_row); - } else if (was_arrow != 0 && lists && was_arrow == pico4_setup_hit_arrow(x, y)) { - u.list_page = pico4_setup_list_turn(u.list_page, was_arrow, list_count(u)); - } else if (was_ipd != 0 && was_ipd == pico4_setup_hit_ipd(x, y)) { - lens(was_ipd); + break; + } + case vr::VREvent_ScrollDiscrete: { + const float dx = e.data.scroll.xdelta, dy = e.data.scroll.ydelta; + if (u.page == PICO4_SETUP_IPD && dx != 0) { + lens(dx > 0 ? 1 : -1); + } else if (dy != 0 && fabsf(dy) >= fabsf(dx) && list_count(u) > 0) { + u.first = pico4_list_scroll(u.first, dy > 0 ? -1 : 1, kListRows, list_count(u)); + s.hover = pico4_hits_at(&s.hits, x, y); + dirty = true; } + break; + } + default: break; } } while (system->PollNextEvent(&e, sizeof(e))) { @@ -1331,7 +1341,7 @@ main(int argc, char **argv) if (u.scan_job.status == 0) { pico4_setup_network found[32]; u.nets.assign(found, found + pico4_setup_parse_networks(u.scan_job.output.c_str(), found, 32)); - u.list_page = pico4_setup_list_turn(u.list_page, 0, list_count(u)); + u.first = pico4_list_scroll(u.first, 0, kListRows, list_count(u)); } u.scanned = true; dirty = true; @@ -1360,9 +1370,10 @@ main(int argc, char **argv) u.wifi_message = texts.steam_text("Settings_Internet_Connection_Successful", "Connection successful!"); wifi_step(PICO4_WIFI_LIST); } - if (u.active && (u.wifi == PICO4_WIFI_JOINING || u.keyboard) && now >= next_frame_draw) { - // The spinner's and the caret's motion. - next_frame_draw = now + 0.05; + // What moves: the spinners, the caret, the pairing's countdown. + const bool moving = u.wifi == PICO4_WIFI_JOINING || u.keyboard || (u.page == PICO4_SETUP_CONTROLLERS && (s.pairing != 0 || !s.known)); + if (u.active && moving && now >= next_frame_draw) { + next_frame_draw = now + 1.0 / 15; dirty = true; } if (u.active && u.page == PICO4_SETUP_WIFI && u.wifi_on && now >= u.next_scan && !u.connect_job.running()) { @@ -1378,7 +1389,7 @@ main(int argc, char **argv) } dirty = true; } - if (u.ipd_target >= 0 && u.ipd >= 0 && u.ipd_target != u.ipd && !u.ipd_job.running()) { + if (u.ipd_target >= 0 && u.ipd >= 0 && u.ipd_target != u.ipd && !u.ipd_job.running() && !u.ipd_drag) { char mm[16]; snprintf(mm, sizeof(mm), "%d.%02d", u.ipd_target / 100, u.ipd_target % 100); u.ipd_job.start({"pico4-lens", "set", mm}); @@ -1402,18 +1413,35 @@ main(int argc, char **argv) } if (pair.poll() && pair.done) { const int result = pair.answers.empty() ? -1 : pico4_pairing_answer(pair.answers.back().c_str()); - if (result != 1 && !s.hands_free) { - s.message = texts.our("controller_pair_failed"); + if (result == 1) { + // Connected now, before the next status: the next listening takes the other hand. + (s.pairing == 1 ? s.left : s.right) = true; } s.pairing = 0; next_status = 0; // the new state, now dirty = true; } - // Hands-free pairing: nothing points at the panel while no controller is there. - if (u.active && s.known && !s.left && !s.right && s.pairing == 0 && now - started >= PICO4_PAIRING_WAIT_S) { - s.hands_free = true; - s.last_hands_free = pico4_pairing_hands_free(false, false, s.last_hands_free); - start_pairing(s.last_hands_free); + // The pairing page listens by itself, hand after hand, until both are there; elsewhere, with no + // controller left (switched off meanwhile), nothing can point at the panel: back to it. + if (u.active && s.known && s.pairing == 0 && !pair.active() && !(s.left && s.right) && now >= next_pair_try) { + if (u.page == PICO4_SETUP_CONTROLLERS) { + int hand = pico4_pairing_missing(s.left, s.right); + if (hand == 0) { + hand = s.last_hands_free = pico4_pairing_hands_free(false, false, s.last_hands_free); + } + start_pairing(hand); + } else if (!s.left && !s.right) { + enter(PICO4_SETUP_CONTROLLERS); + } + } + // Both there: a moment to see it, then the lenses. + if (u.active && u.page == PICO4_SETUP_CONTROLLERS && s.left && s.right) { + if (s.both_at == 0) { + s.both_at = now; + dirty = true; + } else if (now - s.both_at >= kBothShown) { + enter(PICO4_SETUP_IPD); + } } if (now >= next_oobe) { next_oobe = now + 5; @@ -1435,7 +1463,7 @@ main(int argc, char **argv) show(); u.active = true; u.language = std::max(0, pico4_setup_language_index(texts.language.c_str())); - enter(PICO4_SETUP_WELCOME); + enter(pico4_setup_first(s.left, s.right)); printf("pico4-onboarding: setup started in %s\n", texts.language.c_str()); fflush(stdout); // SteamVR waits for nobody meanwhile; the room view follows once its system UI is up. diff --git a/phoenix/pico4-monado/pico4-onboarding.strings b/phoenix/pico4-monado/pico4-onboarding.strings index e492079..d9484ea 100644 --- a/phoenix/pico4-monado/pico4-onboarding.strings +++ b/phoenix/pico4-monado/pico4-onboarding.strings @@ -6,8 +6,6 @@ # "\n" breaks a line; %s is filled in, in order. [english] -setup_welcome = Let's set up your PICO 4: language, time zone, Wi-Fi, controllers and lenses. -setup_welcome_point = Point a controller at Continue and pull its trigger. setup_language_note = Steam starts in this language. setup_timezone_note = The headset's clock and Steam use this time zone. setup_timezone_failed = The time zone could not be set. @@ -17,31 +15,17 @@ setup_wifi_later = You can join a network later in Steam's settings too. setup_ipd_title = Lens distance setup_ipd_text = Move the lenses until the picture is sharp and comfortable. setup_ipd_range = The PICO 4 takes 58 to 72 mm. -lens_close_warning = Closer than 62 mm, the lenses can press on your nose. Tick here to accept that, then move them closer with care. setup_ready_title = Ready for Steam setup_ready_text = Steam starts when you choose %s. Sign in there. -skip = Skip close = Close pair = Pair controllers_title = Controllers controllers_both = Both controllers connect to the headset by themselves when they are on. -controller_left = Left controller: %s -controller_right = Right controller: %s -controller_connected = connected -controller_waiting = waiting for it -controller_missing = not connected -controller_pair_left = To pair the left controller: -controller_pair_right = To pair the right controller: -controller_pair_how = Hold its trigger and its PICO button together for about 6 seconds. -controller_point_left = Point the other controller at Pair to pair the left one. -controller_point_right = Point the other controller at Pair to pair the right one. controller_pair_failed = No controller paired. Try again with Pair. controller_radio = The controller radio is not ready yet. settings_title = Overpressure Settings lens_preset = User %s lens_stored = Stored -lens_empty = empty -lens_hint = Press a user to move the lenses. Hold it to store the distance. lens_move_failed = The lenses could not be moved. lens_not_reached = The lenses did not reach the distance. lens_store_failed = The distance could not be stored. @@ -64,10 +48,45 @@ updates_start_failed = The updater could not be started. updates_part_update = The release updates_part_kernel = The kernel updates_part_packages = The system's packages +about_title = About +about_versions = Versions +about_system = System +about_recovery = Recovery +about_packages = Packages +about_kernel = Kernel +about_driver = Headset driver +home_controllers_both = Both controllers connected +home_controller_missing = A controller is not connected +updates_update_to = Update to %s +updates_whats_new = What's new +thumb_lr = Left and right on the thumbstick +thumb_scroll = Thumbstick to scroll +lens_close_short = Closer than 62 mm, the lenses can press on your nose. +lens_closer = Move closer anyway +lens_people = People +lens_hold = Hold to store +controller_left_name = Left controller +controller_right_name = Right controller +status_connected = Connected +status_missing = Not connected +pair_listening = Hold its trigger and PICO button · listening %s +hand_left = Left +hand_right = Right +pair_title_left = Pair the left controller +pair_title_right = Pair the right controller +pair_hold = Hold both, about 6 seconds, until it vibrates. +key_trigger = Trigger +key_pico = PICO button +listening = Listening +pair_both = Both controllers are connected +pair_next = Next: the lens distance. +step_of = Step %s of %s +looks_sharp = Looks sharp +continue_one = Continue with one +pair_can_point_left = Your left controller can point now. +pair_can_point_right = Your right controller can point now. [german] -setup_welcome = Richten wir deine PICO 4 ein: Sprache, Zeitzone, WLAN, Controller und Linsen. -setup_welcome_point = Richte einen Controller auf „Weiter“ und drücke seinen Trigger. setup_language_note = Steam startet in dieser Sprache. setup_timezone_note = Die Uhr des Headsets und Steam verwenden diese Zeitzone. setup_timezone_failed = Die Zeitzone konnte nicht eingestellt werden. @@ -77,31 +96,17 @@ setup_wifi_later = Du kannst dich auch später in den Einstellungen von Steam mi setup_ipd_title = Linsenabstand setup_ipd_text = Bewege die Linsen, bis das Bild scharf und angenehm ist. setup_ipd_range = Die PICO 4 nimmt 58 bis 72 mm. -lens_close_warning = Unter 62 mm können die Linsen auf die Nase drücken. Hake das hier an, um das zu akzeptieren, und bewege sie dann vorsichtig näher. setup_ready_title = Bereit für Steam setup_ready_text = Steam startet, wenn du „%s“ wählst. Melde dich dort an. -skip = Überspringen close = Schließen pair = Koppeln controllers_title = Controller controllers_both = Beide Controller verbinden sich von selbst mit dem Headset, wenn sie eingeschaltet sind. -controller_left = Linker Controller: %s -controller_right = Rechter Controller: %s -controller_connected = verbunden -controller_waiting = wird erwartet -controller_missing = nicht verbunden -controller_pair_left = So koppelst du den linken Controller: -controller_pair_right = So koppelst du den rechten Controller: -controller_pair_how = Halte seinen Trigger und seine PICO-Taste etwa 6 Sekunden lang gleichzeitig gedrückt. -controller_point_left = Richte den anderen Controller auf „Koppeln“, um den linken zu koppeln. -controller_point_right = Richte den anderen Controller auf „Koppeln“, um den rechten zu koppeln. controller_pair_failed = Kein Controller gekoppelt. Versuche es mit „Koppeln“ erneut. controller_radio = Der Funk der Controller ist noch nicht bereit. settings_title = Overpressure-Einstellungen lens_preset = Person %s lens_stored = Gespeichert -lens_empty = leer -lens_hint = Tippe eine Person an, um die Linsen zu bewegen. Halte sie, um den Abstand zu speichern. lens_move_failed = Die Linsen konnten nicht bewegt werden. lens_not_reached = Die Linsen haben den Abstand nicht erreicht. lens_store_failed = Der Abstand konnte nicht gespeichert werden. @@ -124,10 +129,45 @@ updates_start_failed = Die Aktualisierung konnte nicht gestartet werden. updates_part_update = Die Version updates_part_kernel = Der Kernel updates_part_packages = Die Pakete des Systems +about_title = Über +about_versions = Versionen +about_system = System +about_recovery = Recovery +about_packages = Pakete +about_kernel = Kernel +about_driver = Headset-Treiber +home_controllers_both = Beide Controller verbunden +home_controller_missing = Ein Controller ist nicht verbunden +updates_update_to = Update auf %s +updates_whats_new = Neuerungen +thumb_lr = Thumbstick nach links und rechts +thumb_scroll = Mit dem Thumbstick scrollen +lens_close_short = Unter 62 mm können die Linsen auf deine Nase drücken. +lens_closer = Trotzdem näher +lens_people = Personen +lens_hold = Halten zum Speichern +controller_left_name = Linker Controller +controller_right_name = Rechter Controller +status_connected = Verbunden +status_missing = Nicht verbunden +pair_listening = Halte Trigger und PICO-Taste · empfangsbereit %s +hand_left = Links +hand_right = Rechts +pair_title_left = Linken Controller koppeln +pair_title_right = Rechten Controller koppeln +pair_hold = Halte beide etwa 6 Sekunden, bis er vibriert. +key_trigger = Trigger +key_pico = PICO-Taste +listening = Empfangsbereit +pair_both = Beide Controller sind verbunden +pair_next = Weiter: der Linsenabstand. +step_of = Schritt %s von %s +looks_sharp = Sieht scharf aus +continue_one = Mit einem weiter +pair_can_point_left = Dein linker Controller kann jetzt zeigen. +pair_can_point_right = Dein rechter Controller kann jetzt zeigen. [french] -setup_welcome = Configurons votre PICO 4 : langue, fuseau horaire, Wi-Fi, manettes et lentilles. -setup_welcome_point = Pointez une manette vers « Continuer » et appuyez sur sa gâchette. setup_language_note = Steam démarrera dans cette langue. setup_timezone_note = L'horloge du casque et Steam utilisent ce fuseau horaire. setup_timezone_failed = Le fuseau horaire n'a pas pu être défini. @@ -137,31 +177,17 @@ setup_wifi_later = Vous pourrez aussi rejoindre un réseau plus tard dans les pa setup_ipd_title = Écart des lentilles setup_ipd_text = Déplacez les lentilles jusqu'à ce que l'image soit nette et confortable. setup_ipd_range = La PICO 4 accepte de 58 à 72 mm. -lens_close_warning = En dessous de 62 mm, les lentilles peuvent appuyer sur votre nez. Cochez ici pour l'accepter, puis rapprochez-les avec prudence. setup_ready_title = Prêt pour Steam setup_ready_text = Steam démarre lorsque vous choisissez « %s ». Connectez-vous ensuite. -skip = Passer close = Fermer pair = Associer controllers_title = Manettes controllers_both = Les deux manettes se connectent seules au casque lorsqu'elles sont allumées. -controller_left = Manette gauche : %s -controller_right = Manette droite : %s -controller_connected = connectée -controller_waiting = en attente -controller_missing = non connectée -controller_pair_left = Pour associer la manette gauche : -controller_pair_right = Pour associer la manette droite : -controller_pair_how = Maintenez sa gâchette et son bouton PICO enfoncés ensemble pendant environ 6 secondes. -controller_point_left = Pointez l'autre manette vers « Associer » pour associer la gauche. -controller_point_right = Pointez l'autre manette vers « Associer » pour associer la droite. controller_pair_failed = Aucune manette associée. Réessayez avec « Associer ». controller_radio = La radio des manettes n'est pas encore prête. settings_title = Paramètres Overpressure lens_preset = Utilisateur %s lens_stored = Enregistré -lens_empty = vide -lens_hint = Appuyez sur un utilisateur pour déplacer les lentilles. Maintenez-le pour enregistrer l'écart. lens_move_failed = Les lentilles n'ont pas pu être déplacées. lens_not_reached = Les lentilles n'ont pas atteint l'écart. lens_store_failed = L'écart n'a pas pu être enregistré. @@ -184,10 +210,45 @@ updates_start_failed = La mise à jour n'a pas pu être lancée. updates_part_update = La version updates_part_kernel = Le noyau updates_part_packages = Les paquets du système +about_title = À propos +about_versions = Versions +about_system = Système +about_recovery = Recovery +about_packages = Paquets +about_kernel = Noyau +about_driver = Pilote du casque +home_controllers_both = Les deux manettes connectées +home_controller_missing = Une manette n'est pas connectée +updates_update_to = Mettre à jour vers %s +updates_whats_new = Nouveautés +thumb_lr = Joystick à gauche et à droite +thumb_scroll = Joystick pour faire défiler +lens_close_short = En dessous de 62 mm, les lentilles peuvent appuyer sur votre nez. +lens_closer = Rapprocher quand même +lens_people = Personnes +lens_hold = Maintenir pour enregistrer +controller_left_name = Manette gauche +controller_right_name = Manette droite +status_connected = Connectée +status_missing = Non connectée +pair_listening = Maintenez la gâchette et le bouton PICO · à l'écoute %s +hand_left = Gauche +hand_right = Droite +pair_title_left = Associer la manette gauche +pair_title_right = Associer la manette droite +pair_hold = Maintenez les deux environ 6 secondes, jusqu'à ce qu'elle vibre. +key_trigger = Gâchette +key_pico = Bouton PICO +listening = À l'écoute +pair_both = Les deux manettes sont connectées +pair_next = Ensuite : l'écart des lentilles. +step_of = Étape %s sur %s +looks_sharp = C'est net +continue_one = Continuer avec une seule +pair_can_point_left = Votre manette gauche peut maintenant pointer. +pair_can_point_right = Votre manette droite peut maintenant pointer. [spanish] -setup_welcome = Vamos a configurar tus PICO 4: idioma, zona horaria, wifi, mandos y lentes. -setup_welcome_point = Apunta con un mando a «Continuar» y pulsa su gatillo. setup_language_note = Steam se iniciará en este idioma. setup_timezone_note = El reloj de las gafas y Steam usan esta zona horaria. setup_timezone_failed = No se ha podido establecer la zona horaria. @@ -197,31 +258,17 @@ setup_wifi_later = También puedes conectarte a una red más tarde en los ajuste setup_ipd_title = Distancia de las lentes setup_ipd_text = Mueve las lentes hasta que la imagen se vea nítida y cómoda. setup_ipd_range = Las PICO 4 admiten de 58 a 72 mm. -lens_close_warning = Por debajo de 62 mm, las lentes pueden presionar la nariz. Marca aquí para aceptarlo y acércalas con cuidado. setup_ready_title = Listo para Steam setup_ready_text = Steam se inicia cuando eliges «%s». Inicia sesión allí. -skip = Omitir close = Cerrar pair = Emparejar controllers_title = Mandos controllers_both = Los dos mandos se conectan solos a las gafas cuando están encendidos. -controller_left = Mando izquierdo: %s -controller_right = Mando derecho: %s -controller_connected = conectado -controller_waiting = esperándolo -controller_missing = no conectado -controller_pair_left = Para emparejar el mando izquierdo: -controller_pair_right = Para emparejar el mando derecho: -controller_pair_how = Mantén pulsados a la vez su gatillo y su botón PICO durante unos 6 segundos. -controller_point_left = Apunta con el otro mando a «Emparejar» para emparejar el izquierdo. -controller_point_right = Apunta con el otro mando a «Emparejar» para emparejar el derecho. controller_pair_failed = No se ha emparejado ningún mando. Vuelve a intentarlo con «Emparejar». controller_radio = La radio de los mandos aún no está lista. settings_title = Ajustes de Overpressure lens_preset = Usuario %s lens_stored = Guardado -lens_empty = vacío -lens_hint = Pulsa un usuario para mover las lentes. Mantenlo pulsado para guardar la distancia. lens_move_failed = No se han podido mover las lentes. lens_not_reached = Las lentes no han llegado a la distancia. lens_store_failed = No se ha podido guardar la distancia. @@ -244,10 +291,45 @@ updates_start_failed = No se pudo iniciar el actualizador. updates_part_update = La versión updates_part_kernel = El kernel updates_part_packages = Los paquetes del sistema +about_title = Acerca de +about_versions = Versiones +about_system = Sistema +about_recovery = Recovery +about_packages = Paquetes +about_kernel = Kernel +about_driver = Controlador de las gafas +home_controllers_both = Ambos mandos conectados +home_controller_missing = Hay un mando sin conectar +updates_update_to = Actualizar a %s +updates_whats_new = Novedades +thumb_lr = Joystick a izquierda y derecha +thumb_scroll = Joystick para desplazarte +lens_close_short = Por debajo de 62 mm, las lentes pueden presionarte la nariz. +lens_closer = Acercar de todos modos +lens_people = Personas +lens_hold = Mantén para guardar +controller_left_name = Mando izquierdo +controller_right_name = Mando derecho +status_connected = Conectado +status_missing = No conectado +pair_listening = Mantén el gatillo y el botón PICO · escuchando %s +hand_left = Izquierdo +hand_right = Derecho +pair_title_left = Emparejar el mando izquierdo +pair_title_right = Emparejar el mando derecho +pair_hold = Mantén ambos unos 6 segundos, hasta que vibre. +key_trigger = Gatillo +key_pico = Botón PICO +listening = Escuchando +pair_both = Los dos mandos están conectados +pair_next = Siguiente: la distancia de las lentes. +step_of = Paso %s de %s +looks_sharp = Se ve nítido +continue_one = Continuar con uno +pair_can_point_left = Ya puedes apuntar con el mando izquierdo. +pair_can_point_right = Ya puedes apuntar con el mando derecho. [latam] -setup_welcome = Configuremos tus PICO 4: idioma, zona horaria, wifi, controles y lentes. -setup_welcome_point = Apunta un control a "Continuar" y presiona su gatillo. setup_language_note = Steam se iniciará en este idioma. setup_timezone_note = El reloj del visor y Steam usan esta zona horaria. setup_timezone_failed = No se pudo establecer la zona horaria. @@ -257,31 +339,17 @@ setup_wifi_later = También puedes conectarte a una red más tarde en la configu setup_ipd_title = Distancia de las lentes setup_ipd_text = Mueve las lentes hasta que la imagen se vea nítida y cómoda. setup_ipd_range = El PICO 4 admite de 58 a 72 mm. -lens_close_warning = Por debajo de 62 mm, los lentes pueden presionar la nariz. Marca aquí para aceptarlo y acércalos con cuidado. setup_ready_title = Listo para Steam setup_ready_text = Steam se inicia cuando eliges "%s". Inicia sesión ahí. -skip = Omitir close = Cerrar pair = Vincular controllers_title = Controles controllers_both = Ambos controles se conectan solos al visor cuando están encendidos. -controller_left = Control izquierdo: %s -controller_right = Control derecho: %s -controller_connected = conectado -controller_waiting = esperándolo -controller_missing = no conectado -controller_pair_left = Para vincular el control izquierdo: -controller_pair_right = Para vincular el control derecho: -controller_pair_how = Mantén presionados juntos su gatillo y su botón PICO durante unos 6 segundos. -controller_point_left = Apunta el otro control a "Vincular" para vincular el izquierdo. -controller_point_right = Apunta el otro control a "Vincular" para vincular el derecho. controller_pair_failed = No se vinculó ningún control. Inténtalo de nuevo con "Vincular". controller_radio = La radio de los controles aún no está lista. settings_title = Configuración de Overpressure lens_preset = Usuario %s lens_stored = Guardado -lens_empty = vacío -lens_hint = Presiona un usuario para mover los lentes. Mantenlo presionado para guardar la distancia. lens_move_failed = No se pudieron mover los lentes. lens_not_reached = Los lentes no llegaron a la distancia. lens_store_failed = No se pudo guardar la distancia. @@ -304,10 +372,45 @@ updates_start_failed = No se pudo iniciar el actualizador. updates_part_update = La versión updates_part_kernel = El kernel updates_part_packages = Los paquetes del sistema +about_title = Acerca de +about_versions = Versiones +about_system = Sistema +about_recovery = Recovery +about_packages = Paquetes +about_kernel = Kernel +about_driver = Controlador del visor +home_controllers_both = Ambos controles conectados +home_controller_missing = Hay un control sin conectar +updates_update_to = Actualizar a %s +updates_whats_new = Novedades +thumb_lr = Joystick a izquierda y derecha +thumb_scroll = Joystick para desplazarte +lens_close_short = Por debajo de 62 mm, las lentes pueden presionarte la nariz. +lens_closer = Acercar de todos modos +lens_people = Personas +lens_hold = Mantén presionado para guardar +controller_left_name = Control izquierdo +controller_right_name = Control derecho +status_connected = Conectado +status_missing = No conectado +pair_listening = Mantén el gatillo y el botón PICO · escuchando %s +hand_left = Izquierdo +hand_right = Derecho +pair_title_left = Vincular el control izquierdo +pair_title_right = Vincular el control derecho +pair_hold = Mantén ambos unos 6 segundos, hasta que vibre. +key_trigger = Gatillo +key_pico = Botón PICO +listening = Escuchando +pair_both = Ambos controles están conectados +pair_next = Siguiente: la distancia de las lentes. +step_of = Paso %s de %s +looks_sharp = Se ve nítido +continue_one = Continuar con uno +pair_can_point_left = Ya puedes apuntar con el control izquierdo. +pair_can_point_right = Ya puedes apuntar con el control derecho. [italian] -setup_welcome = Configuriamo il tuo PICO 4: lingua, fuso orario, Wi-Fi, controller e lenti. -setup_welcome_point = Punta un controller su "Continua" e premi il suo grilletto. setup_language_note = Steam si avvierà in questa lingua. setup_timezone_note = L'orologio del visore e Steam usano questo fuso orario. setup_timezone_failed = Impossibile impostare il fuso orario. @@ -317,31 +420,17 @@ setup_wifi_later = Puoi connetterti a una rete anche più tardi nelle impostazio setup_ipd_title = Distanza delle lenti setup_ipd_text = Sposta le lenti finché l'immagine non è nitida e confortevole. setup_ipd_range = Il PICO 4 supporta da 58 a 72 mm. -lens_close_warning = Sotto i 62 mm le lenti possono premere sul naso. Spunta qui per accettarlo, poi avvicinale con cautela. setup_ready_title = Pronto per Steam setup_ready_text = Steam si avvia quando scegli "%s". Accedi lì. -skip = Salta close = Chiudi pair = Associa controllers_title = Controller controllers_both = Entrambi i controller si collegano da soli al visore quando sono accesi. -controller_left = Controller sinistro: %s -controller_right = Controller destro: %s -controller_connected = collegato -controller_waiting = in attesa -controller_missing = non collegato -controller_pair_left = Per associare il controller sinistro: -controller_pair_right = Per associare il controller destro: -controller_pair_how = Tieni premuti insieme il suo grilletto e il suo pulsante PICO per circa 6 secondi. -controller_point_left = Punta l'altro controller su "Associa" per associare quello sinistro. -controller_point_right = Punta l'altro controller su "Associa" per associare quello destro. controller_pair_failed = Nessun controller associato. Riprova con "Associa". controller_radio = La radio dei controller non è ancora pronta. settings_title = Impostazioni di Overpressure lens_preset = Utente %s lens_stored = Salvato -lens_empty = vuoto -lens_hint = Premi un utente per spostare le lenti. Tienilo premuto per salvare la distanza. lens_move_failed = Impossibile spostare le lenti. lens_not_reached = Le lenti non hanno raggiunto la distanza. lens_store_failed = Impossibile salvare la distanza. @@ -364,10 +453,45 @@ updates_start_failed = Impossibile avviare l'aggiornamento. updates_part_update = La versione updates_part_kernel = Il kernel updates_part_packages = I pacchetti del sistema +about_title = Informazioni +about_versions = Versioni +about_system = Sistema +about_recovery = Recovery +about_packages = Pacchetti +about_kernel = Kernel +about_driver = Driver del visore +home_controllers_both = Entrambi i controller collegati +home_controller_missing = Un controller non è collegato +updates_update_to = Aggiorna a %s +updates_whats_new = Novità +thumb_lr = Levetta a sinistra e a destra +thumb_scroll = Levetta per scorrere +lens_close_short = Sotto i 62 mm, le lenti possono premere sul naso. +lens_closer = Avvicina comunque +lens_people = Persone +lens_hold = Tieni premuto per salvare +controller_left_name = Controller sinistro +controller_right_name = Controller destro +status_connected = Collegato +status_missing = Non collegato +pair_listening = Tieni premuti grilletto e tasto PICO · in ascolto %s +hand_left = Sinistro +hand_right = Destro +pair_title_left = Associa il controller sinistro +pair_title_right = Associa il controller destro +pair_hold = Tienili premuti entrambi per circa 6 secondi, finché non vibra. +key_trigger = Grilletto +key_pico = Tasto PICO +listening = In ascolto +pair_both = Entrambi i controller sono collegati +pair_next = Prossimo passo: la distanza delle lenti. +step_of = Passo %s di %s +looks_sharp = È nitido +continue_one = Continua con uno +pair_can_point_left = Ora puoi puntare con il controller sinistro. +pair_can_point_right = Ora puoi puntare con il controller destro. [brazilian] -setup_welcome = Vamos configurar seu PICO 4: idioma, fuso horário, Wi-Fi, controles e lentes. -setup_welcome_point = Aponte um controle para "Continuar" e aperte o gatilho. setup_language_note = O Steam vai iniciar neste idioma. setup_timezone_note = O relógio do headset e o Steam usam este fuso horário. setup_timezone_failed = Não foi possível definir o fuso horário. @@ -377,31 +501,17 @@ setup_wifi_later = Você também pode se conectar a uma rede depois, nas configu setup_ipd_title = Distância das lentes setup_ipd_text = Mova as lentes até a imagem ficar nítida e confortável. setup_ipd_range = O PICO 4 aceita de 58 a 72 mm. -lens_close_warning = Abaixo de 62 mm, as lentes podem pressionar o nariz. Marque aqui para aceitar e aproxime-as com cuidado. setup_ready_title = Pronto para o Steam setup_ready_text = O Steam inicia quando você escolhe "%s". Entre nele. -skip = Pular close = Fechar pair = Parear controllers_title = Controles controllers_both = Os dois controles se conectam sozinhos ao headset quando estão ligados. -controller_left = Controle esquerdo: %s -controller_right = Controle direito: %s -controller_connected = conectado -controller_waiting = aguardando -controller_missing = não conectado -controller_pair_left = Para parear o controle esquerdo: -controller_pair_right = Para parear o controle direito: -controller_pair_how = Segure o gatilho e o botão PICO dele ao mesmo tempo por cerca de 6 segundos. -controller_point_left = Aponte o outro controle para "Parear" para parear o esquerdo. -controller_point_right = Aponte o outro controle para "Parear" para parear o direito. controller_pair_failed = Nenhum controle pareado. Tente de novo com "Parear". controller_radio = O rádio dos controles ainda não está pronto. settings_title = Configurações do Overpressure lens_preset = Usuário %s lens_stored = Salvo -lens_empty = vazio -lens_hint = Toque em um usuário para mover as lentes. Segure para salvar a distância. lens_move_failed = Não foi possível mover as lentes. lens_not_reached = As lentes não chegaram à distância. lens_store_failed = Não foi possível salvar a distância. @@ -424,10 +534,45 @@ updates_start_failed = Não foi possível iniciar o atualizador. updates_part_update = A versão updates_part_kernel = O kernel updates_part_packages = Os pacotes do sistema +about_title = Sobre +about_versions = Versões +about_system = Sistema +about_recovery = Recovery +about_packages = Pacotes +about_kernel = Kernel +about_driver = Driver do headset +home_controllers_both = Ambos os controles conectados +home_controller_missing = Um controle não está conectado +updates_update_to = Atualizar para %s +updates_whats_new = Novidades +thumb_lr = Analógico para a esquerda e a direita +thumb_scroll = Analógico para rolar +lens_close_short = Abaixo de 62 mm, as lentes podem pressionar seu nariz. +lens_closer = Aproximar mesmo assim +lens_people = Pessoas +lens_hold = Segure para salvar +controller_left_name = Controle esquerdo +controller_right_name = Controle direito +status_connected = Conectado +status_missing = Não conectado +pair_listening = Segure o gatilho e o botão PICO · aguardando %s +hand_left = Esquerdo +hand_right = Direito +pair_title_left = Parear o controle esquerdo +pair_title_right = Parear o controle direito +pair_hold = Segure os dois por cerca de 6 segundos, até ele vibrar. +key_trigger = Gatilho +key_pico = Botão PICO +listening = Aguardando +pair_both = Os dois controles estão conectados +pair_next = Próximo: a distância das lentes. +step_of = Etapa %s de %s +looks_sharp = Está nítido +continue_one = Continuar com um +pair_can_point_left = Seu controle esquerdo já pode apontar. +pair_can_point_right = Seu controle direito já pode apontar. [portuguese] -setup_welcome = Vamos configurar os seus PICO 4: idioma, fuso horário, Wi-Fi, comandos e lentes. -setup_welcome_point = Aponte um comando para "Continuar" e prima o gatilho. setup_language_note = O Steam vai iniciar neste idioma. setup_timezone_note = O relógio do visor e o Steam utilizam este fuso horário. setup_timezone_failed = Não foi possível definir o fuso horário. @@ -437,31 +582,17 @@ setup_wifi_later = Também pode ligar-se a uma rede mais tarde, nas definições setup_ipd_title = Distância das lentes setup_ipd_text = Mova as lentes até a imagem ficar nítida e confortável. setup_ipd_range = Os PICO 4 aceitam de 58 a 72 mm. -lens_close_warning = Abaixo de 62 mm, as lentes podem pressionar o nariz. Assinale aqui para aceitar e aproxime-as com cuidado. setup_ready_title = Pronto para o Steam setup_ready_text = O Steam inicia quando escolher "%s". Inicie sessão nele. -skip = Ignorar close = Fechar pair = Emparelhar controllers_title = Comandos controllers_both = Os dois comandos ligam-se sozinhos ao visor quando estão ligados. -controller_left = Comando esquerdo: %s -controller_right = Comando direito: %s -controller_connected = ligado -controller_waiting = à espera -controller_missing = não ligado -controller_pair_left = Para emparelhar o comando esquerdo: -controller_pair_right = Para emparelhar o comando direito: -controller_pair_how = Mantenha premidos ao mesmo tempo o gatilho e o botão PICO durante cerca de 6 segundos. -controller_point_left = Aponte o outro comando para "Emparelhar" para emparelhar o esquerdo. -controller_point_right = Aponte o outro comando para "Emparelhar" para emparelhar o direito. controller_pair_failed = Nenhum comando emparelhado. Tente novamente com "Emparelhar". controller_radio = O rádio dos comandos ainda não está pronto. settings_title = Definições do Overpressure lens_preset = Utilizador %s lens_stored = Guardado -lens_empty = vazio -lens_hint = Prima um utilizador para mover as lentes. Mantenha premido para guardar a distância. lens_move_failed = Não foi possível mover as lentes. lens_not_reached = As lentes não chegaram à distância. lens_store_failed = Não foi possível guardar a distância. @@ -484,10 +615,45 @@ updates_start_failed = Não foi possível iniciar o atualizador. updates_part_update = A versão updates_part_kernel = O kernel updates_part_packages = Os pacotes do sistema +about_title = Acerca +about_versions = Versões +about_system = Sistema +about_recovery = Recovery +about_packages = Pacotes +about_kernel = Kernel +about_driver = Controlador do visor +home_controllers_both = Ambos os comandos ligados +home_controller_missing = Um comando não está ligado +updates_update_to = Atualizar para %s +updates_whats_new = Novidades +thumb_lr = Joystick para a esquerda e a direita +thumb_scroll = Joystick para deslocar +lens_close_short = Abaixo de 62 mm, as lentes podem pressionar o nariz. +lens_closer = Aproximar mesmo assim +lens_people = Pessoas +lens_hold = Mantenha premido para guardar +controller_left_name = Comando esquerdo +controller_right_name = Comando direito +status_connected = Ligado +status_missing = Não ligado +pair_listening = Mantenha premidos o gatilho e o botão PICO · à escuta %s +hand_left = Esquerdo +hand_right = Direito +pair_title_left = Emparelhar o comando esquerdo +pair_title_right = Emparelhar o comando direito +pair_hold = Mantenha ambos premidos cerca de 6 segundos, até vibrar. +key_trigger = Gatilho +key_pico = Botão PICO +listening = À escuta +pair_both = Ambos os comandos estão ligados +pair_next = A seguir: a distância das lentes. +step_of = Passo %s de %s +looks_sharp = Está nítido +continue_one = Continuar com um +pair_can_point_left = O seu comando esquerdo já pode apontar. +pair_can_point_right = O seu comando direito já pode apontar. [dutch] -setup_welcome = Laten we je PICO 4 instellen: taal, tijdzone, wifi, controllers en lenzen. -setup_welcome_point = Richt een controller op 'Doorgaan' en druk de trekker in. setup_language_note = Steam start in deze taal. setup_timezone_note = De klok van de headset en Steam gebruiken deze tijdzone. setup_timezone_failed = De tijdzone kon niet worden ingesteld. @@ -497,31 +663,17 @@ setup_wifi_later = Je kunt later ook verbinding maken met een netwerk via de ins setup_ipd_title = Lensafstand setup_ipd_text = Verplaats de lenzen tot het beeld scherp en comfortabel is. setup_ipd_range = De PICO 4 ondersteunt 58 tot 72 mm. -lens_close_warning = Onder 62 mm kunnen de lenzen op je neus drukken. Vink dit aan om dat te accepteren en schuif ze dan voorzichtig dichterbij. setup_ready_title = Klaar voor Steam setup_ready_text = Steam start zodra je '%s' kiest. Meld je daar aan. -skip = Overslaan close = Sluiten pair = Koppelen controllers_title = Controllers controllers_both = Beide controllers maken vanzelf verbinding met de headset als ze aan staan. -controller_left = Linkercontroller: %s -controller_right = Rechtercontroller: %s -controller_connected = verbonden -controller_waiting = wordt verwacht -controller_missing = niet verbonden -controller_pair_left = Zo koppel je de linkercontroller: -controller_pair_right = Zo koppel je de rechtercontroller: -controller_pair_how = Houd de trekker en de PICO-knop ongeveer 6 seconden tegelijk ingedrukt. -controller_point_left = Richt de andere controller op 'Koppelen' om de linker te koppelen. -controller_point_right = Richt de andere controller op 'Koppelen' om de rechter te koppelen. controller_pair_failed = Geen controller gekoppeld. Probeer het opnieuw met 'Koppelen'. controller_radio = De radio van de controllers is nog niet klaar. settings_title = Overpressure-instellingen lens_preset = Gebruiker %s lens_stored = Opgeslagen -lens_empty = leeg -lens_hint = Druk op een gebruiker om de lenzen te verplaatsen. Houd vast om de afstand op te slaan. lens_move_failed = De lenzen konden niet worden verplaatst. lens_not_reached = De lenzen hebben de afstand niet bereikt. lens_store_failed = De afstand kon niet worden opgeslagen. @@ -544,10 +696,45 @@ updates_start_failed = De updater kon niet worden gestart. updates_part_update = De versie updates_part_kernel = De kernel updates_part_packages = De pakketten van het systeem +about_title = Over +about_versions = Versies +about_system = Systeem +about_recovery = Recovery +about_packages = Pakketten +about_kernel = Kernel +about_driver = Headsetdriver +home_controllers_both = Beide controllers verbonden +home_controller_missing = Een controller is niet verbonden +updates_update_to = Updaten naar %s +updates_whats_new = Wat is er nieuw +thumb_lr = Thumbstick naar links en rechts +thumb_scroll = Thumbstick om te scrollen +lens_close_short = Onder 62 mm kunnen de lenzen op je neus drukken. +lens_closer = Toch dichterbij +lens_people = Personen +lens_hold = Vasthouden om op te slaan +controller_left_name = Linkercontroller +controller_right_name = Rechtercontroller +status_connected = Verbonden +status_missing = Niet verbonden +pair_listening = Houd de trigger en PICO-knop vast · luistert %s +hand_left = Links +hand_right = Rechts +pair_title_left = Linkercontroller koppelen +pair_title_right = Rechtercontroller koppelen +pair_hold = Houd beide ongeveer 6 seconden vast, tot hij trilt. +key_trigger = Trigger +key_pico = PICO-knop +listening = Luistert +pair_both = Beide controllers zijn verbonden +pair_next = Volgende: de lensafstand. +step_of = Stap %s van %s +looks_sharp = Ziet er scherp uit +continue_one = Doorgaan met één +pair_can_point_left = Je linkercontroller kan nu aanwijzen. +pair_can_point_right = Je rechtercontroller kan nu aanwijzen. [danish] -setup_welcome = Lad os konfigurere dit PICO 4: sprog, tidszone, wi-fi, controllere og linser. -setup_welcome_point = Peg en controller på "Fortsæt", og tryk på dens aftrækker. setup_language_note = Steam starter på dette sprog. setup_timezone_note = Headsettets ur og Steam bruger denne tidszone. setup_timezone_failed = Tidszonen kunne ikke indstilles. @@ -557,31 +744,17 @@ setup_wifi_later = Du kan også oprette forbindelse til et netværk senere i Ste setup_ipd_title = Linseafstand setup_ipd_text = Flyt linserne, indtil billedet er skarpt og behageligt. setup_ipd_range = PICO 4 understøtter 58 til 72 mm. -lens_close_warning = Under 62 mm kan linserne trykke på næsen. Sæt flueben her for at acceptere det, og flyt dem så forsigtigt tættere. setup_ready_title = Klar til Steam setup_ready_text = Steam starter, når du vælger "%s". Log ind der. -skip = Spring over close = Luk pair = Par controllers_title = Controllere controllers_both = Begge controllere opretter selv forbindelse til headsettet, når de er tændt. -controller_left = Venstre controller: %s -controller_right = Højre controller: %s -controller_connected = forbundet -controller_waiting = venter på den -controller_missing = ikke forbundet -controller_pair_left = Sådan parrer du den venstre controller: -controller_pair_right = Sådan parrer du den højre controller: -controller_pair_how = Hold dens aftrækker og PICO-knap nede samtidig i cirka 6 sekunder. -controller_point_left = Peg den anden controller på "Par" for at parre den venstre. -controller_point_right = Peg den anden controller på "Par" for at parre den højre. controller_pair_failed = Ingen controller blev parret. Prøv igen med "Par". controller_radio = Controllernes radio er ikke klar endnu. settings_title = Overpressure-indstillinger lens_preset = Bruger %s lens_stored = Gemt -lens_empty = tom -lens_hint = Tryk på en bruger for at flytte linserne. Hold for at gemme afstanden. lens_move_failed = Linserne kunne ikke flyttes. lens_not_reached = Linserne nåede ikke afstanden. lens_store_failed = Afstanden kunne ikke gemmes. @@ -604,10 +777,45 @@ updates_start_failed = Opdateringen kunne ikke startes. updates_part_update = Versionen updates_part_kernel = Kernen updates_part_packages = Systemets pakker +about_title = Om +about_versions = Versioner +about_system = System +about_recovery = Recovery +about_packages = Pakker +about_kernel = Kerne +about_driver = Headsetdriver +home_controllers_both = Begge controllere forbundet +home_controller_missing = En controller er ikke forbundet +updates_update_to = Opdater til %s +updates_whats_new = Nyheder +thumb_lr = Thumbstick til venstre og højre +thumb_scroll = Thumbstick for at rulle +lens_close_short = Under 62 mm kan linserne trykke på din næse. +lens_closer = Tættere alligevel +lens_people = Personer +lens_hold = Hold for at gemme +controller_left_name = Venstre controller +controller_right_name = Højre controller +status_connected = Forbundet +status_missing = Ikke forbundet +pair_listening = Hold aftrækkeren og PICO-knappen · lytter %s +hand_left = Venstre +hand_right = Højre +pair_title_left = Par venstre controller +pair_title_right = Par højre controller +pair_hold = Hold begge i cirka 6 sekunder, indtil den vibrerer. +key_trigger = Aftrækker +key_pico = PICO-knap +listening = Lytter +pair_both = Begge controllere er forbundet +pair_next = Næste: linseafstanden. +step_of = Trin %s af %s +looks_sharp = Det er skarpt +continue_one = Fortsæt med én +pair_can_point_left = Din venstre controller kan pege nu. +pair_can_point_right = Din højre controller kan pege nu. [swedish] -setup_welcome = Nu konfigurerar vi ditt PICO 4: språk, tidszon, wifi, handkontroller och linser. -setup_welcome_point = Rikta en handkontroll mot "Fortsätt" och tryck på dess avtryckare. setup_language_note = Steam startar på det här språket. setup_timezone_note = Headsetets klocka och Steam använder den här tidszonen. setup_timezone_failed = Det gick inte att ställa in tidszonen. @@ -617,31 +825,17 @@ setup_wifi_later = Du kan också ansluta till ett nätverk senare i Steams inst setup_ipd_title = Linsavstånd setup_ipd_text = Flytta linserna tills bilden är skarp och bekväm. setup_ipd_range = PICO 4 klarar 58 till 72 mm. -lens_close_warning = Under 62 mm kan linserna trycka mot näsan. Kryssa här för att godta det och flytta dem sedan försiktigt närmare. setup_ready_title = Redo för Steam setup_ready_text = Steam startar när du väljer "%s". Logga in där. -skip = Hoppa över close = Stäng pair = Parkoppla controllers_title = Handkontroller controllers_both = Båda handkontrollerna ansluter själva till headsetet när de är på. -controller_left = Vänster handkontroll: %s -controller_right = Höger handkontroll: %s -controller_connected = ansluten -controller_waiting = väntar på den -controller_missing = inte ansluten -controller_pair_left = Så parkopplar du den vänstra handkontrollen: -controller_pair_right = Så parkopplar du den högra handkontrollen: -controller_pair_how = Håll dess avtryckare och PICO-knapp intryckta samtidigt i ungefär 6 sekunder. -controller_point_left = Rikta den andra handkontrollen mot "Parkoppla" för att parkoppla den vänstra. -controller_point_right = Rikta den andra handkontrollen mot "Parkoppla" för att parkoppla den högra. controller_pair_failed = Ingen handkontroll parkopplades. Försök igen med "Parkoppla". controller_radio = Handkontrollernas radio är inte redo än. settings_title = Overpressure-inställningar lens_preset = Användare %s lens_stored = Sparad -lens_empty = tom -lens_hint = Tryck på en användare för att flytta linserna. Håll in för att spara avståndet. lens_move_failed = Linserna kunde inte flyttas. lens_not_reached = Linserna nådde inte avståndet. lens_store_failed = Avståndet kunde inte sparas. @@ -664,10 +858,45 @@ updates_start_failed = Uppdateringen kunde inte startas. updates_part_update = Versionen updates_part_kernel = Kärnan updates_part_packages = Systemets paket +about_title = Om +about_versions = Versioner +about_system = System +about_recovery = Recovery +about_packages = Paket +about_kernel = Kärna +about_driver = Headsetdrivrutin +home_controllers_both = Båda handkontrollerna anslutna +home_controller_missing = En handkontroll är inte ansluten +updates_update_to = Uppdatera till %s +updates_whats_new = Nyheter +thumb_lr = Styrspaken åt vänster och höger +thumb_scroll = Styrspaken för att rulla +lens_close_short = Under 62 mm kan linserna trycka mot näsan. +lens_closer = Närmare ändå +lens_people = Personer +lens_hold = Håll in för att spara +controller_left_name = Vänster handkontroll +controller_right_name = Höger handkontroll +status_connected = Ansluten +status_missing = Inte ansluten +pair_listening = Håll in avtryckaren och PICO-knappen · lyssnar %s +hand_left = Vänster +hand_right = Höger +pair_title_left = Parkoppla vänster handkontroll +pair_title_right = Parkoppla höger handkontroll +pair_hold = Håll in båda i cirka 6 sekunder, tills den vibrerar. +key_trigger = Avtryckare +key_pico = PICO-knapp +listening = Lyssnar +pair_both = Båda handkontrollerna är anslutna +pair_next = Nästa: linsavståndet. +step_of = Steg %s av %s +looks_sharp = Ser skarpt ut +continue_one = Fortsätt med en +pair_can_point_left = Din vänstra handkontroll kan peka nu. +pair_can_point_right = Din högra handkontroll kan peka nu. [norwegian] -setup_welcome = La oss sette opp PICO 4: språk, tidssone, wifi, kontrollere og linser. -setup_welcome_point = Pek en kontroller mot «Fortsett» og trykk på avtrekkeren. setup_language_note = Steam starter på dette språket. setup_timezone_note = Klokken i headsettet og Steam bruker denne tidssonen. setup_timezone_failed = Kunne ikke angi tidssonen. @@ -677,31 +906,17 @@ setup_wifi_later = Du kan også koble til et nettverk senere i innstillingene ti setup_ipd_title = Linseavstand setup_ipd_text = Flytt linsene til bildet er skarpt og behagelig. setup_ipd_range = PICO 4 støtter 58 til 72 mm. -lens_close_warning = Under 62 mm kan linsene trykke mot nesen. Huk av her for å godta det, og flytt dem så forsiktig nærmere. setup_ready_title = Klar for Steam setup_ready_text = Steam starter når du velger «%s». Logg på der. -skip = Hopp over close = Lukk pair = Par controllers_title = Kontrollere controllers_both = Begge kontrollerne kobler seg til headsettet av seg selv når de er på. -controller_left = Venstre kontroller: %s -controller_right = Høyre kontroller: %s -controller_connected = tilkoblet -controller_waiting = venter på den -controller_missing = ikke tilkoblet -controller_pair_left = Slik parer du venstre kontroller: -controller_pair_right = Slik parer du høyre kontroller: -controller_pair_how = Hold avtrekkeren og PICO-knappen inne samtidig i omtrent 6 sekunder. -controller_point_left = Pek den andre kontrolleren mot «Par» for å pare den venstre. -controller_point_right = Pek den andre kontrolleren mot «Par» for å pare den høyre. controller_pair_failed = Ingen kontroller ble paret. Prøv igjen med «Par». controller_radio = Radioen til kontrollerne er ikke klar ennå. settings_title = Overpressure-innstillinger lens_preset = Bruker %s lens_stored = Lagret -lens_empty = tom -lens_hint = Trykk på en bruker for å flytte linsene. Hold inne for å lagre avstanden. lens_move_failed = Linsene kunne ikke flyttes. lens_not_reached = Linsene nådde ikke avstanden. lens_store_failed = Avstanden kunne ikke lagres. @@ -724,10 +939,45 @@ updates_start_failed = Oppdateringen kunne ikke startes. updates_part_update = Versjonen updates_part_kernel = Kjernen updates_part_packages = Systemets pakker +about_title = Om +about_versions = Versjoner +about_system = System +about_recovery = Recovery +about_packages = Pakker +about_kernel = Kjerne +about_driver = Headsetdriver +home_controllers_both = Begge kontrollerne tilkoblet +home_controller_missing = En kontroller er ikke tilkoblet +updates_update_to = Oppdater til %s +updates_whats_new = Nyheter +thumb_lr = Styrespaken til venstre og høyre +thumb_scroll = Styrespaken for å rulle +lens_close_short = Under 62 mm kan linsene trykke mot nesen. +lens_closer = Nærmere likevel +lens_people = Personer +lens_hold = Hold for å lagre +controller_left_name = Venstre kontroller +controller_right_name = Høyre kontroller +status_connected = Tilkoblet +status_missing = Ikke tilkoblet +pair_listening = Hold avtrekkeren og PICO-knappen · lytter %s +hand_left = Venstre +hand_right = Høyre +pair_title_left = Par venstre kontroller +pair_title_right = Par høyre kontroller +pair_hold = Hold begge i omtrent 6 sekunder, til den vibrerer. +key_trigger = Avtrekker +key_pico = PICO-knapp +listening = Lytter +pair_both = Begge kontrollerne er tilkoblet +pair_next = Neste: linseavstanden. +step_of = Trinn %s av %s +looks_sharp = Ser skarpt ut +continue_one = Fortsett med én +pair_can_point_left = Den venstre kontrolleren din kan peke nå. +pair_can_point_right = Den høyre kontrolleren din kan peke nå. [finnish] -setup_welcome = Otetaan PICO 4 käyttöön: kieli, aikavyöhyke, Wi-Fi, ohjaimet ja linssit. -setup_welcome_point = Osoita ohjaimella Jatka-painiketta ja paina sen liipaisinta. setup_language_note = Steam käynnistyy tällä kielellä. setup_timezone_note = Lasien kello ja Steam käyttävät tätä aikavyöhykettä. setup_timezone_failed = Aikavyöhykettä ei voitu asettaa. @@ -737,31 +987,17 @@ setup_wifi_later = Voit myös liittyä verkkoon myöhemmin Steamin asetuksissa. setup_ipd_title = Linssien etäisyys setup_ipd_text = Siirrä linssejä, kunnes kuva on terävä ja miellyttävä. setup_ipd_range = PICO 4 tukee 58–72 mm. -lens_close_warning = Alle 62 mm:n etäisyydellä linssit voivat painaa nenää. Hyväksy tämä valitsemalla ruutu ja siirrä linssejä sitten varovasti lähemmäs. setup_ready_title = Valmis Steamiin setup_ready_text = Steam käynnistyy, kun valitset %s. Kirjaudu siellä sisään. -skip = Ohita close = Sulje pair = Yhdistä pariksi controllers_title = Ohjaimet controllers_both = Molemmat ohjaimet yhdistyvät laseihin itsestään, kun ne ovat päällä. -controller_left = Vasen ohjain: %s -controller_right = Oikea ohjain: %s -controller_connected = yhdistetty -controller_waiting = odotetaan -controller_missing = ei yhdistetty -controller_pair_left = Vasemman ohjaimen yhdistäminen pariksi: -controller_pair_right = Oikean ohjaimen yhdistäminen pariksi: -controller_pair_how = Pidä sen liipaisinta ja PICO-painiketta painettuina yhtä aikaa noin 6 sekuntia. -controller_point_left = Osoita toisella ohjaimella Yhdistä pariksi -painiketta vasemman yhdistämiseksi. -controller_point_right = Osoita toisella ohjaimella Yhdistä pariksi -painiketta oikean yhdistämiseksi. controller_pair_failed = Yhtään ohjainta ei yhdistetty. Yritä uudelleen Yhdistä pariksi -painikkeella. controller_radio = Ohjainten radio ei ole vielä valmis. settings_title = Overpressure-asetukset lens_preset = Käyttäjä %s lens_stored = Tallennettu -lens_empty = tyhjä -lens_hint = Siirrä linssejä painamalla käyttäjää. Tallenna etäisyys pitämällä painettuna. lens_move_failed = Linssejä ei voitu siirtää. lens_not_reached = Linssit eivät saavuttaneet etäisyyttä. lens_store_failed = Etäisyyttä ei voitu tallentaa. @@ -784,10 +1020,45 @@ updates_start_failed = Päivitystä ei voitu käynnistää. updates_part_update = Versio updates_part_kernel = Ydin updates_part_packages = Järjestelmän paketit +about_title = Tietoja +about_versions = Versiot +about_system = Järjestelmä +about_recovery = Recovery +about_packages = Paketit +about_kernel = Ydin +about_driver = Lasien ajuri +home_controllers_both = Molemmat ohjaimet yhdistetty +home_controller_missing = Yksi ohjain ei ole yhteydessä +updates_update_to = Päivitä versioon %s +updates_whats_new = Uutta +thumb_lr = Tatti vasemmalle ja oikealle +thumb_scroll = Vieritä tatilla +lens_close_short = Alle 62 mm:ssä linssit voivat painaa nenääsi. +lens_closer = Lähemmäs silti +lens_people = Henkilöt +lens_hold = Tallenna pitämällä painettuna +controller_left_name = Vasen ohjain +controller_right_name = Oikea ohjain +status_connected = Yhdistetty +status_missing = Ei yhdistetty +pair_listening = Pidä liipaisinta ja PICO-painiketta · kuunnellaan %s +hand_left = Vasen +hand_right = Oikea +pair_title_left = Yhdistä vasen ohjain pariksi +pair_title_right = Yhdistä oikea ohjain pariksi +pair_hold = Pidä molempia noin 6 sekuntia, kunnes se värisee. +key_trigger = Liipaisin +key_pico = PICO-painike +listening = Kuunnellaan +pair_both = Molemmat ohjaimet on yhdistetty +pair_next = Seuraavaksi: linssien etäisyys. +step_of = Vaihe %s/%s +looks_sharp = Näyttää terävältä +continue_one = Jatka yhdellä +pair_can_point_left = Vasen ohjaimesi voi nyt osoittaa. +pair_can_point_right = Oikea ohjaimesi voi nyt osoittaa. [polish] -setup_welcome = Skonfigurujmy PICO 4: język, strefę czasową, Wi-Fi, kontrolery i soczewki. -setup_welcome_point = Wskaż kontrolerem przycisk „Kontynuuj” i naciśnij jego spust. setup_language_note = Steam uruchomi się w tym języku. setup_timezone_note = Zegar gogli i Steam używają tej strefy czasowej. setup_timezone_failed = Nie udało się ustawić strefy czasowej. @@ -797,31 +1068,17 @@ setup_wifi_later = Z siecią możesz połączyć się także później w ustawie setup_ipd_title = Rozstaw soczewek setup_ipd_text = Przesuwaj soczewki, aż obraz będzie ostry i wygodny. setup_ipd_range = PICO 4 obsługuje od 58 do 72 mm. -lens_close_warning = Poniżej 62 mm soczewki mogą uciskać nos. Zaznacz tutaj, aby to zaakceptować, a potem ostrożnie je zbliż. setup_ready_title = Gotowe do Steam setup_ready_text = Steam uruchomi się po wybraniu „%s”. Zaloguj się w nim. -skip = Pomiń close = Zamknij pair = Sparuj controllers_title = Kontrolery controllers_both = Oba kontrolery łączą się z goglami same, gdy są włączone. -controller_left = Lewy kontroler: %s -controller_right = Prawy kontroler: %s -controller_connected = połączony -controller_waiting = oczekiwanie -controller_missing = niepołączony -controller_pair_left = Aby sparować lewy kontroler: -controller_pair_right = Aby sparować prawy kontroler: -controller_pair_how = Przytrzymaj jednocześnie jego spust i przycisk PICO przez około 6 sekund. -controller_point_left = Wskaż drugim kontrolerem przycisk „Sparuj”, aby sparować lewy. -controller_point_right = Wskaż drugim kontrolerem przycisk „Sparuj”, aby sparować prawy. controller_pair_failed = Nie sparowano żadnego kontrolera. Spróbuj ponownie przyciskiem „Sparuj”. controller_radio = Radio kontrolerów nie jest jeszcze gotowe. settings_title = Ustawienia Overpressure lens_preset = Użytkownik %s lens_stored = Zapisano -lens_empty = pusty -lens_hint = Naciśnij użytkownika, aby przesunąć soczewki. Przytrzymaj, aby zapisać odległość. lens_move_failed = Nie udało się przesunąć soczewek. lens_not_reached = Soczewki nie osiągnęły odległości. lens_store_failed = Nie udało się zapisać odległości. @@ -844,10 +1101,45 @@ updates_start_failed = Nie udało się uruchomić aktualizacji. updates_part_update = Wersja updates_part_kernel = Jądro updates_part_packages = Pakiety systemu +about_title = Informacje +about_versions = Wersje +about_system = System +about_recovery = Recovery +about_packages = Pakiety +about_kernel = Jądro +about_driver = Sterownik gogli +home_controllers_both = Oba kontrolery połączone +home_controller_missing = Jeden kontroler nie jest połączony +updates_update_to = Aktualizuj do %s +updates_whats_new = Co nowego +thumb_lr = Drążek w lewo i w prawo +thumb_scroll = Przewijaj drążkiem +lens_close_short = Poniżej 62 mm soczewki mogą uciskać nos. +lens_closer = Mimo to bliżej +lens_people = Osoby +lens_hold = Przytrzymaj, aby zapisać +controller_left_name = Lewy kontroler +controller_right_name = Prawy kontroler +status_connected = Połączony +status_missing = Niepołączony +pair_listening = Przytrzymaj spust i przycisk PICO · nasłuchiwanie %s +hand_left = Lewy +hand_right = Prawy +pair_title_left = Sparuj lewy kontroler +pair_title_right = Sparuj prawy kontroler +pair_hold = Przytrzymaj oba przez około 6 sekund, aż zawibruje. +key_trigger = Spust +key_pico = Przycisk PICO +listening = Nasłuchiwanie +pair_both = Oba kontrolery są połączone +pair_next = Dalej: rozstaw soczewek. +step_of = Krok %s z %s +looks_sharp = Obraz jest ostry +continue_one = Kontynuuj z jednym +pair_can_point_left = Lewy kontroler może już wskazywać. +pair_can_point_right = Prawy kontroler może już wskazywać. [czech] -setup_welcome = Pojďme nastavit vaše PICO 4: jazyk, časové pásmo, Wi-Fi, ovladače a čočky. -setup_welcome_point = Namiřte ovladač na „Pokračovat“ a stiskněte jeho spoušť. setup_language_note = Steam se spustí v tomto jazyce. setup_timezone_note = Hodiny headsetu a Steam používají toto časové pásmo. setup_timezone_failed = Časové pásmo se nepodařilo nastavit. @@ -857,31 +1149,17 @@ setup_wifi_later = K síti se můžete připojit i později v nastavení Steamu. setup_ipd_title = Rozteč čoček setup_ipd_text = Posouvejte čočky, dokud nebude obraz ostrý a pohodlný. setup_ipd_range = PICO 4 podporuje 58 až 72 mm. -lens_close_warning = Pod 62 mm mohou čočky tlačit na nos. Zaškrtněte zde, že to přijímáte, a pak je opatrně přibližte. setup_ready_title = Připraveno pro Steam setup_ready_text = Steam se spustí, když zvolíte „%s“. Přihlaste se v něm. -skip = Přeskočit close = Zavřít pair = Spárovat controllers_title = Ovladače controllers_both = Oba ovladače se po zapnutí připojí k headsetu samy. -controller_left = Levý ovladač: %s -controller_right = Pravý ovladač: %s -controller_connected = připojen -controller_waiting = čeká se na něj -controller_missing = nepřipojen -controller_pair_left = Spárování levého ovladače: -controller_pair_right = Spárování pravého ovladače: -controller_pair_how = Podržte jeho spoušť a tlačítko PICO současně asi 6 sekund. -controller_point_left = Namiřte druhý ovladač na „Spárovat“ a spárujte levý. -controller_point_right = Namiřte druhý ovladač na „Spárovat“ a spárujte pravý. controller_pair_failed = Žádný ovladač nebyl spárován. Zkuste to znovu pomocí „Spárovat“. controller_radio = Rádio ovladačů ještě není připravené. settings_title = Nastavení Overpressure lens_preset = Uživatel %s lens_stored = Uloženo -lens_empty = prázdné -lens_hint = Stiskněte uživatele, aby se čočky posunuly. Podržením uložíte vzdálenost. lens_move_failed = Čočky se nepodařilo posunout. lens_not_reached = Čočky nedosáhly vzdálenosti. lens_store_failed = Vzdálenost se nepodařilo uložit. @@ -904,10 +1182,45 @@ updates_start_failed = Aktualizaci se nepodařilo spustit. updates_part_update = Verze updates_part_kernel = Jádro updates_part_packages = Balíčky systému +about_title = O systému +about_versions = Verze +about_system = Systém +about_recovery = Recovery +about_packages = Balíčky +about_kernel = Jádro +about_driver = Ovladač headsetu +home_controllers_both = Oba ovladače připojeny +home_controller_missing = Jeden ovladač není připojen +updates_update_to = Aktualizovat na %s +updates_whats_new = Co je nového +thumb_lr = Páčka doleva a doprava +thumb_scroll = Posouvání páčkou +lens_close_short = Pod 62 mm mohou čočky tlačit na nos. +lens_closer = Přesto blíž +lens_people = Osoby +lens_hold = Podržením uložíte +controller_left_name = Levý ovladač +controller_right_name = Pravý ovladač +status_connected = Připojeno +status_missing = Nepřipojeno +pair_listening = Podržte spoušť a tlačítko PICO · naslouchání %s +hand_left = Levý +hand_right = Pravý +pair_title_left = Spárovat levý ovladač +pair_title_right = Spárovat pravý ovladač +pair_hold = Podržte obě asi 6 sekund, dokud nezavibruje. +key_trigger = Spoušť +key_pico = Tlačítko PICO +listening = Naslouchání +pair_both = Oba ovladače jsou připojeny +pair_next = Dále: rozteč čoček. +step_of = Krok %s z %s +looks_sharp = Obraz je ostrý +continue_one = Pokračovat s jedním +pair_can_point_left = Levým ovladačem teď můžete ukazovat. +pair_can_point_right = Pravým ovladačem teď můžete ukazovat. [hungarian] -setup_welcome = Állítsuk be a PICO 4-et: nyelv, időzóna, Wi-Fi, kontrollerek és lencsék. -setup_welcome_point = Mutass egy kontrollerrel a „Folytatás” gombra, és húzd meg a ravaszát. setup_language_note = A Steam ezen a nyelven indul el. setup_timezone_note = A headset órája és a Steam ezt az időzónát használja. setup_timezone_failed = Az időzónát nem sikerült beállítani. @@ -917,31 +1230,17 @@ setup_wifi_later = Később a Steam beállításaiban is csatlakozhatsz hálóza setup_ipd_title = Lencsetávolság setup_ipd_text = Mozgasd a lencséket, amíg a kép éles és kényelmes nem lesz. setup_ipd_range = A PICO 4 58 és 72 mm között állítható. -lens_close_warning = 62 mm alatt a lencsék nyomhatják az orrodat. Pipáld ki itt, hogy elfogadod, majd óvatosan közelítsd őket. setup_ready_title = Kész a Steamre setup_ready_text = A Steam elindul, amikor a(z) „%s” lehetőséget választod. Jelentkezz be benne. -skip = Kihagyás close = Bezárás pair = Párosítás controllers_title = Kontrollerek controllers_both = Bekapcsolva mindkét kontroller magától csatlakozik a headsethez. -controller_left = Bal kontroller: %s -controller_right = Jobb kontroller: %s -controller_connected = csatlakoztatva -controller_waiting = várakozás rá -controller_missing = nincs csatlakoztatva -controller_pair_left = A bal kontroller párosítása: -controller_pair_right = A jobb kontroller párosítása: -controller_pair_how = Tartsd lenyomva egyszerre a ravaszát és a PICO gombját körülbelül 6 másodpercig. -controller_point_left = Mutass a másik kontrollerrel a „Párosítás” gombra a bal párosításához. -controller_point_right = Mutass a másik kontrollerrel a „Párosítás” gombra a jobb párosításához. controller_pair_failed = Egy kontroller sem párosodott. Próbáld újra a „Párosítás” gombbal. controller_radio = A kontrollerek rádiója még nem áll készen. settings_title = Overpressure-beállítások lens_preset = %s. felhasználó lens_stored = Mentve -lens_empty = üres -lens_hint = Nyomj meg egy felhasználót a lencsék mozgatásához. Tartsd nyomva a távolság mentéséhez. lens_move_failed = A lencséket nem sikerült mozgatni. lens_not_reached = A lencsék nem érték el a távolságot. lens_store_failed = A távolságot nem sikerült menteni. @@ -964,10 +1263,45 @@ updates_start_failed = A frissítőt nem sikerült elindítani. updates_part_update = A kiadás updates_part_kernel = A kernel updates_part_packages = A rendszer csomagjai +about_title = Névjegy +about_versions = Verziók +about_system = Rendszer +about_recovery = Recovery +about_packages = Csomagok +about_kernel = Kernel +about_driver = Headset-illesztőprogram +home_controllers_both = Mindkét kontroller csatlakoztatva +home_controller_missing = Egy kontroller nincs csatlakoztatva +updates_update_to = Frissítés erre: %s +updates_whats_new = Újdonságok +thumb_lr = Joystick balra és jobbra +thumb_scroll = Görgetés a joystickkal +lens_close_short = 62 mm alatt a lencsék nyomhatják az orrodat. +lens_closer = Mégis közelebb +lens_people = Személyek +lens_hold = Tartsd lenyomva a mentéshez +controller_left_name = Bal kontroller +controller_right_name = Jobb kontroller +status_connected = Csatlakoztatva +status_missing = Nincs csatlakoztatva +pair_listening = Tartsd lenyomva a ravaszt és a PICO gombot · figyelés %s +hand_left = Bal +hand_right = Jobb +pair_title_left = A bal kontroller párosítása +pair_title_right = A jobb kontroller párosítása +pair_hold = Tartsd lenyomva mindkettőt kb. 6 másodpercig, amíg rezegni nem kezd. +key_trigger = Ravasz +key_pico = PICO gomb +listening = Figyelés +pair_both = Mindkét kontroller csatlakoztatva van +pair_next = Következik: a lencsetávolság. +step_of = %s/%s. lépés +looks_sharp = Éles a kép +continue_one = Folytatás eggyel +pair_can_point_left = A bal kontrollereddel most már mutathatsz. +pair_can_point_right = A jobb kontrollereddel most már mutathatsz. [romanian] -setup_welcome = Să configurăm ochelarii PICO 4: limba, fusul orar, Wi-Fi, controlerele și lentilele. -setup_welcome_point = Îndreaptă un controler spre „Continuă” și apasă-i trăgaciul. setup_language_note = Steam va porni în această limbă. setup_timezone_note = Ceasul ochelarilor și Steam folosesc acest fus orar. setup_timezone_failed = Fusul orar nu a putut fi setat. @@ -977,31 +1311,17 @@ setup_wifi_later = Te poți conecta la o rețea și mai târziu, din setările S setup_ipd_title = Distanța dintre lentile setup_ipd_text = Mută lentilele până când imaginea este clară și confortabilă. setup_ipd_range = PICO 4 acceptă între 58 și 72 mm. -lens_close_warning = Sub 62 mm, lentilele pot apăsa pe nas. Bifează aici ca să accepți, apoi apropie-le cu grijă. setup_ready_title = Gata pentru Steam setup_ready_text = Steam pornește când alegi „%s”. Conectează-te acolo. -skip = Omite close = Închide pair = Asociază controllers_title = Controlere controllers_both = Ambele controlere se conectează singure la ochelari când sunt pornite. -controller_left = Controler stânga: %s -controller_right = Controler dreapta: %s -controller_connected = conectat -controller_waiting = în așteptare -controller_missing = neconectat -controller_pair_left = Pentru a asocia controlerul din stânga: -controller_pair_right = Pentru a asocia controlerul din dreapta: -controller_pair_how = Ține apăsate împreună trăgaciul și butonul PICO aproximativ 6 secunde. -controller_point_left = Îndreaptă celălalt controler spre „Asociază” pentru a-l asocia pe cel din stânga. -controller_point_right = Îndreaptă celălalt controler spre „Asociază” pentru a-l asocia pe cel din dreapta. controller_pair_failed = Niciun controler asociat. Încearcă din nou cu „Asociază”. controller_radio = Radioul controlerelor nu este încă pregătit. settings_title = Setări Overpressure lens_preset = Utilizator %s lens_stored = Salvat -lens_empty = gol -lens_hint = Apasă un utilizator pentru a mișca lentilele. Ține apăsat pentru a salva distanța. lens_move_failed = Lentilele nu au putut fi mișcate. lens_not_reached = Lentilele nu au ajuns la distanță. lens_store_failed = Distanța nu a putut fi salvată. @@ -1024,10 +1344,45 @@ updates_start_failed = Actualizarea nu a putut fi pornită. updates_part_update = Versiunea updates_part_kernel = Nucleul updates_part_packages = Pachetele sistemului +about_title = Despre +about_versions = Versiuni +about_system = Sistem +about_recovery = Recovery +about_packages = Pachete +about_kernel = Kernel +about_driver = Driverul ochelarilor +home_controllers_both = Ambele controlere conectate +home_controller_missing = Un controler nu este conectat +updates_update_to = Actualizează la %s +updates_whats_new = Noutăți +thumb_lr = Joystick la stânga și la dreapta +thumb_scroll = Joystick pentru derulare +lens_close_short = Sub 62 mm, lentilele pot apăsa pe nas. +lens_closer = Mai aproape oricum +lens_people = Persoane +lens_hold = Ține apăsat pentru a salva +controller_left_name = Controler stânga +controller_right_name = Controler dreapta +status_connected = Conectat +status_missing = Neconectat +pair_listening = Ține apăsate trăgaciul și butonul PICO · în ascultare %s +hand_left = Stânga +hand_right = Dreapta +pair_title_left = Asociază controlerul stâng +pair_title_right = Asociază controlerul drept +pair_hold = Ține-le apăsate pe amândouă circa 6 secunde, până vibrează. +key_trigger = Trăgaci +key_pico = Butonul PICO +listening = În ascultare +pair_both = Ambele controlere sunt conectate +pair_next = Urmează: distanța dintre lentile. +step_of = Pasul %s din %s +looks_sharp = Arată clar +continue_one = Continuă cu unul +pair_can_point_left = Controlerul stâng poate indica acum. +pair_can_point_right = Controlerul drept poate indica acum. [bulgarian] -setup_welcome = Нека настроим PICO 4: език, часова зона, Wi-Fi, контролери и лещи. -setup_welcome_point = Насочете контролер към „Продължаване“ и натиснете спусъка му. setup_language_note = Steam ще стартира на този език. setup_timezone_note = Часовникът на очилата и Steam използват тази часова зона. setup_timezone_failed = Часовата зона не можа да бъде зададена. @@ -1037,31 +1392,17 @@ setup_wifi_later = Можете да се свържете с мрежа и по setup_ipd_title = Разстояние между лещите setup_ipd_text = Преместете лещите, докато образът стане ясен и удобен. setup_ipd_range = PICO 4 поддържа от 58 до 72 мм. -lens_close_warning = Под 62 мм лещите може да натискат носа. Отметнете тук, за да приемете това, и ги приближете внимателно. setup_ready_title = Готово за Steam setup_ready_text = Steam стартира, когато изберете „%s“. Влезте там. -skip = Пропускане close = Затваряне pair = Сдвояване controllers_title = Контролери controllers_both = И двата контролера се свързват сами с очилата, когато са включени. -controller_left = Ляв контролер: %s -controller_right = Десен контролер: %s -controller_connected = свързан -controller_waiting = изчакване -controller_missing = не е свързан -controller_pair_left = За да сдвоите левия контролер: -controller_pair_right = За да сдвоите десния контролер: -controller_pair_how = Задръжте едновременно спусъка и бутона PICO за около 6 секунди. -controller_point_left = Насочете другия контролер към „Сдвояване“, за да сдвоите левия. -controller_point_right = Насочете другия контролер към „Сдвояване“, за да сдвоите десния. controller_pair_failed = Не е сдвоен контролер. Опитайте отново със „Сдвояване“. controller_radio = Радиото на контролерите още не е готово. settings_title = Настройки на Overpressure lens_preset = Потребител %s lens_stored = Запазено -lens_empty = празно -lens_hint = Натиснете потребител, за да преместите лещите. Задръжте, за да запазите разстоянието. lens_move_failed = Лещите не можаха да се преместят. lens_not_reached = Лещите не достигнаха разстоянието. lens_store_failed = Разстоянието не можа да се запази. @@ -1084,10 +1425,45 @@ updates_start_failed = Актуализацията не можа да се ст updates_part_update = Версията updates_part_kernel = Ядрото updates_part_packages = Пакетите на системата +about_title = Информация +about_versions = Версии +about_system = Система +about_recovery = Recovery +about_packages = Пакети +about_kernel = Ядро +about_driver = Драйвер на шлема +home_controllers_both = И двата контролера са свързани +home_controller_missing = Един контролер не е свързан +updates_update_to = Актуализиране до %s +updates_whats_new = Какво ново +thumb_lr = Джойстика наляво и надясно +thumb_scroll = Превъртане с джойстика +lens_close_short = Под 62 мм лещите може да натискат носа. +lens_closer = Все пак по-близо +lens_people = Хора +lens_hold = Задръжте за запазване +controller_left_name = Ляв контролер +controller_right_name = Десен контролер +status_connected = Свързан +status_missing = Не е свързан +pair_listening = Задръжте спусъка и бутона PICO · слушане %s +hand_left = Ляв +hand_right = Десен +pair_title_left = Сдвояване на левия контролер +pair_title_right = Сдвояване на десния контролер +pair_hold = Задръжте двата около 6 секунди, докато завибрира. +key_trigger = Спусък +key_pico = Бутон PICO +listening = Слушане +pair_both = И двата контролера са свързани +pair_next = Следва: разстоянието между лещите. +step_of = Стъпка %s от %s +looks_sharp = Изглежда ясно +continue_one = Продължаване с един +pair_can_point_left = Вече можете да сочите с левия контролер. +pair_can_point_right = Вече можете да сочите с десния контролер. [russian] -setup_welcome = Давайте настроим PICO 4: язык, часовой пояс, Wi-Fi, контроллеры и линзы. -setup_welcome_point = Наведите контроллер на «Продолжить» и нажмите его курок. setup_language_note = Steam запустится на этом языке. setup_timezone_note = Часы гарнитуры и Steam используют этот часовой пояс. setup_timezone_failed = Не удалось задать часовой пояс. @@ -1097,31 +1473,17 @@ setup_wifi_later = Подключиться к сети можно и позже setup_ipd_title = Расстояние между линзами setup_ipd_text = Двигайте линзы, пока изображение не станет чётким и комфортным. setup_ipd_range = PICO 4 поддерживает от 58 до 72 мм. -lens_close_warning = Ближе 62 мм линзы могут давить на нос. Отметьте здесь, чтобы принять это, и сдвигайте их осторожно. setup_ready_title = Всё готово для Steam setup_ready_text = Steam запустится, когда вы выберете «%s». Войдите в него. -skip = Пропустить close = Закрыть pair = Связать controllers_title = Контроллеры controllers_both = Оба контроллера сами подключаются к гарнитуре, когда включены. -controller_left = Левый контроллер: %s -controller_right = Правый контроллер: %s -controller_connected = подключён -controller_waiting = ожидание -controller_missing = не подключён -controller_pair_left = Чтобы связать левый контроллер: -controller_pair_right = Чтобы связать правый контроллер: -controller_pair_how = Удерживайте его курок и кнопку PICO одновременно около 6 секунд. -controller_point_left = Наведите другой контроллер на «Связать», чтобы связать левый. -controller_point_right = Наведите другой контроллер на «Связать», чтобы связать правый. controller_pair_failed = Ни один контроллер не связан. Попробуйте снова кнопкой «Связать». controller_radio = Радиомодуль контроллеров ещё не готов. settings_title = Настройки Overpressure lens_preset = Пользователь %s lens_stored = Сохранено -lens_empty = пусто -lens_hint = Нажмите на пользователя, чтобы сдвинуть линзы. Удерживайте, чтобы сохранить расстояние. lens_move_failed = Не удалось сдвинуть линзы. lens_not_reached = Линзы не дошли до расстояния. lens_store_failed = Не удалось сохранить расстояние. @@ -1144,10 +1506,45 @@ updates_start_failed = Не удалось запустить обновлени updates_part_update = Версия updates_part_kernel = Ядро updates_part_packages = Пакеты системы +about_title = О системе +about_versions = Версии +about_system = Система +about_recovery = Recovery +about_packages = Пакеты +about_kernel = Ядро +about_driver = Драйвер гарнитуры +home_controllers_both = Оба контроллера подключены +home_controller_missing = Один контроллер не подключён +updates_update_to = Обновить до %s +updates_whats_new = Что нового +thumb_lr = Стик влево и вправо +thumb_scroll = Стик для прокрутки +lens_close_short = Ближе 62 мм линзы могут давить на нос. +lens_closer = Всё равно ближе +lens_people = Люди +lens_hold = Удерживайте, чтобы сохранить +controller_left_name = Левый контроллер +controller_right_name = Правый контроллер +status_connected = Подключён +status_missing = Не подключён +pair_listening = Удерживайте курок и кнопку PICO · ожидание %s +hand_left = Левый +hand_right = Правый +pair_title_left = Связать левый контроллер +pair_title_right = Связать правый контроллер +pair_hold = Удерживайте обе около 6 секунд, пока он не завибрирует. +key_trigger = Курок +key_pico = Кнопка PICO +listening = Ожидание +pair_both = Оба контроллера подключены +pair_next = Далее: расстояние между линзами. +step_of = Шаг %s из %s +looks_sharp = Изображение чёткое +continue_one = Продолжить с одним +pair_can_point_left = Теперь левым контроллером можно указывать. +pair_can_point_right = Теперь правым контроллером можно указывать. [ukrainian] -setup_welcome = Налаштуймо PICO 4: мову, часовий пояс, Wi-Fi, контролери та лінзи. -setup_welcome_point = Наведіть контролер на «Продовжити» і натисніть його гачок. setup_language_note = Steam запуститься цією мовою. setup_timezone_note = Годинник гарнітури та Steam використовують цей часовий пояс. setup_timezone_failed = Не вдалося встановити часовий пояс. @@ -1157,31 +1554,17 @@ setup_wifi_later = Під'єднатися до мережі можна й пі setup_ipd_title = Відстань між лінзами setup_ipd_text = Рухайте лінзи, доки зображення не стане чітким і зручним. setup_ipd_range = PICO 4 підтримує від 58 до 72 мм. -lens_close_warning = Ближче за 62 мм лінзи можуть тиснути на ніс. Позначте тут, щоб прийняти це, і зсувайте їх обережно. setup_ready_title = Усе готово для Steam setup_ready_text = Steam запуститься, коли ви виберете «%s». Увійдіть у нього. -skip = Пропустити close = Закрити pair = Під'єднати controllers_title = Контролери controllers_both = Обидва контролери самі під'єднуються до гарнітури, коли ввімкнені. -controller_left = Лівий контролер: %s -controller_right = Правий контролер: %s -controller_connected = під'єднано -controller_waiting = очікування -controller_missing = не під'єднано -controller_pair_left = Щоб під'єднати лівий контролер: -controller_pair_right = Щоб під'єднати правий контролер: -controller_pair_how = Утримуйте його гачок і кнопку PICO одночасно близько 6 секунд. -controller_point_left = Наведіть інший контролер на «Під'єднати», щоб під'єднати лівий. -controller_point_right = Наведіть інший контролер на «Під'єднати», щоб під'єднати правий. controller_pair_failed = Жоден контролер не під'єднано. Спробуйте ще раз кнопкою «Під'єднати». controller_radio = Радіомодуль контролерів ще не готовий. settings_title = Налаштування Overpressure lens_preset = Користувач %s lens_stored = Збережено -lens_empty = порожньо -lens_hint = Натисніть користувача, щоб зсунути лінзи. Утримуйте, щоб зберегти відстань. lens_move_failed = Не вдалося зсунути лінзи. lens_not_reached = Лінзи не дійшли до відстані. lens_store_failed = Не вдалося зберегти відстань. @@ -1204,10 +1587,45 @@ updates_start_failed = Не вдалося запустити оновлення updates_part_update = Версія updates_part_kernel = Ядро updates_part_packages = Пакети системи +about_title = Про систему +about_versions = Версії +about_system = Система +about_recovery = Recovery +about_packages = Пакети +about_kernel = Ядро +about_driver = Драйвер гарнітури +home_controllers_both = Обидва контролери під'єднано +home_controller_missing = Один контролер не під'єднано +updates_update_to = Оновити до %s +updates_whats_new = Що нового +thumb_lr = Стик ліворуч і праворуч +thumb_scroll = Стик для прокручування +lens_close_short = Ближче 62 мм лінзи можуть тиснути на ніс. +lens_closer = Все одно ближче +lens_people = Люди +lens_hold = Утримуйте, щоб зберегти +controller_left_name = Лівий контролер +controller_right_name = Правий контролер +status_connected = Під'єднано +status_missing = Не під'єднано +pair_listening = Утримуйте курок і кнопку PICO · очікування %s +hand_left = Лівий +hand_right = Правий +pair_title_left = Під'єднати лівий контролер +pair_title_right = Під'єднати правий контролер +pair_hold = Утримуйте обидві близько 6 секунд, доки він не завібрує. +key_trigger = Курок +key_pico = Кнопка PICO +listening = Очікування +pair_both = Обидва контролери під'єднано +pair_next = Далі: відстань між лінзами. +step_of = Крок %s з %s +looks_sharp = Зображення чітке +continue_one = Продовжити з одним +pair_can_point_left = Тепер лівим контролером можна вказувати. +pair_can_point_right = Тепер правим контролером можна вказувати. [greek] -setup_welcome = Ας ρυθμίσουμε το PICO 4: γλώσσα, ζώνη ώρας, Wi-Fi, χειριστήρια και φακούς. -setup_welcome_point = Στρέψτε ένα χειριστήριο στο «Συνέχεια» και πατήστε τη σκανδάλη του. setup_language_note = Το Steam θα ξεκινήσει σε αυτή τη γλώσσα. setup_timezone_note = Το ρολόι του σετ και το Steam χρησιμοποιούν αυτή τη ζώνη ώρας. setup_timezone_failed = Δεν ήταν δυνατός ο ορισμός της ζώνης ώρας. @@ -1217,31 +1635,17 @@ setup_wifi_later = Μπορείτε να συνδεθείτε σε δίκτυο setup_ipd_title = Απόσταση φακών setup_ipd_text = Μετακινήστε τους φακούς μέχρι η εικόνα να είναι καθαρή και άνετη. setup_ipd_range = Το PICO 4 υποστηρίζει από 58 έως 72 mm. -lens_close_warning = Κάτω από τα 62 mm οι φακοί μπορεί να πιέζουν τη μύτη σας. Επιλέξτε εδώ για να το αποδεχτείτε και πλησιάστε τους με προσοχή. setup_ready_title = Έτοιμο για το Steam setup_ready_text = Το Steam ξεκινά όταν επιλέξετε «%s». Συνδεθείτε εκεί. -skip = Παράλειψη close = Κλείσιμο pair = Σύζευξη controllers_title = Χειριστήρια controllers_both = Και τα δύο χειριστήρια συνδέονται μόνα τους με το σετ όταν είναι αναμμένα. -controller_left = Αριστερό χειριστήριο: %s -controller_right = Δεξί χειριστήριο: %s -controller_connected = συνδεδεμένο -controller_waiting = σε αναμονή -controller_missing = μη συνδεδεμένο -controller_pair_left = Για σύζευξη του αριστερού χειριστηρίου: -controller_pair_right = Για σύζευξη του δεξιού χειριστηρίου: -controller_pair_how = Κρατήστε πατημένα μαζί τη σκανδάλη και το κουμπί PICO για περίπου 6 δευτερόλεπτα. -controller_point_left = Στρέψτε το άλλο χειριστήριο στη «Σύζευξη» για να συζεύξετε το αριστερό. -controller_point_right = Στρέψτε το άλλο χειριστήριο στη «Σύζευξη» για να συζεύξετε το δεξί. controller_pair_failed = Δεν συζεύχθηκε κανένα χειριστήριο. Δοκιμάστε ξανά με τη «Σύζευξη». controller_radio = Ο ασύρματος των χειριστηρίων δεν είναι ακόμα έτοιμος. settings_title = Ρυθμίσεις Overpressure lens_preset = Χρήστης %s lens_stored = Αποθηκεύτηκε -lens_empty = κενό -lens_hint = Πατήστε έναν χρήστη για να μετακινήσετε τους φακούς. Κρατήστε τον για να αποθηκεύσετε την απόσταση. lens_move_failed = Δεν ήταν δυνατή η μετακίνηση των φακών. lens_not_reached = Οι φακοί δεν έφτασαν την απόσταση. lens_store_failed = Δεν ήταν δυνατή η αποθήκευση της απόστασης. @@ -1264,10 +1668,45 @@ updates_start_failed = Η ενημέρωση δεν μπόρεσε να ξεκι updates_part_update = Η έκδοση updates_part_kernel = Ο πυρήνας updates_part_packages = Τα πακέτα του συστήματος +about_title = Πληροφορίες +about_versions = Εκδόσεις +about_system = Σύστημα +about_recovery = Recovery +about_packages = Πακέτα +about_kernel = Πυρήνας +about_driver = Πρόγραμμα οδήγησης headset +home_controllers_both = Και τα δύο χειριστήρια συνδεδεμένα +home_controller_missing = Ένα χειριστήριο δεν είναι συνδεδεμένο +updates_update_to = Ενημέρωση σε %s +updates_whats_new = Τι νέο υπάρχει +thumb_lr = Μοχλός αριστερά και δεξιά +thumb_scroll = Κύλιση με τον μοχλό +lens_close_short = Κάτω από 62 mm, οι φακοί μπορεί να πιέζουν τη μύτη. +lens_closer = Πιο κοντά ούτως ή άλλως +lens_people = Άτομα +lens_hold = Κρατήστε πατημένο για αποθήκευση +controller_left_name = Αριστερό χειριστήριο +controller_right_name = Δεξί χειριστήριο +status_connected = Συνδεδεμένο +status_missing = Μη συνδεδεμένο +pair_listening = Κρατήστε πατημένα τη σκανδάλη και το κουμπί PICO · αναμονή %s +hand_left = Αριστερό +hand_right = Δεξί +pair_title_left = Σύζευξη αριστερού χειριστηρίου +pair_title_right = Σύζευξη δεξιού χειριστηρίου +pair_hold = Κρατήστε τα και τα δύο περίπου 6 δευτερόλεπτα, μέχρι να δονηθεί. +key_trigger = Σκανδάλη +key_pico = Κουμπί PICO +listening = Αναμονή +pair_both = Και τα δύο χειριστήρια είναι συνδεδεμένα +pair_next = Επόμενο: η απόσταση φακών. +step_of = Βήμα %s από %s +looks_sharp = Είναι καθαρό +continue_one = Συνέχεια με ένα +pair_can_point_left = Το αριστερό χειριστήριο μπορεί τώρα να δείχνει. +pair_can_point_right = Το δεξί χειριστήριο μπορεί τώρα να δείχνει. [turkish] -setup_welcome = PICO 4'ünüzü kuralım: dil, saat dilimi, Wi-Fi, kumandalar ve lensler. -setup_welcome_point = Bir kumandayı "Devam"a doğrultun ve tetiğine basın. setup_language_note = Steam bu dilde başlayacak. setup_timezone_note = Başlığın saati ve Steam bu saat dilimini kullanır. setup_timezone_failed = Saat dilimi ayarlanamadı. @@ -1277,31 +1716,17 @@ setup_wifi_later = Bir ağa daha sonra Steam ayarlarından da bağlanabilirsiniz setup_ipd_title = Lens mesafesi setup_ipd_text = Görüntü net ve rahat olana kadar lensleri hareket ettirin. setup_ipd_range = PICO 4, 58 ile 72 mm arasını destekler. -lens_close_warning = 62 mm'nin altında lensler burnunuza bastırabilir. Bunu kabul etmek için burayı işaretleyin, ardından onları dikkatle yaklaştırın. setup_ready_title = Steam'e hazır setup_ready_text = Steam, "%s" düğmesini seçtiğinizde başlar. Orada giriş yapın. -skip = Atla close = Kapat pair = Eşleştir controllers_title = Kumandalar controllers_both = İki kumanda da açıkken başlığa kendiliğinden bağlanır. -controller_left = Sol kumanda: %s -controller_right = Sağ kumanda: %s -controller_connected = bağlı -controller_waiting = bekleniyor -controller_missing = bağlı değil -controller_pair_left = Sol kumandayı eşleştirmek için: -controller_pair_right = Sağ kumandayı eşleştirmek için: -controller_pair_how = Tetiğini ve PICO düğmesini birlikte yaklaşık 6 saniye basılı tutun. -controller_point_left = Solu eşleştirmek için diğer kumandayı "Eşleştir"e doğrultun. -controller_point_right = Sağı eşleştirmek için diğer kumandayı "Eşleştir"e doğrultun. controller_pair_failed = Hiçbir kumanda eşleşmedi. "Eşleştir" ile yeniden deneyin. controller_radio = Kumandaların telsizi henüz hazır değil. settings_title = Overpressure Ayarları lens_preset = Kullanıcı %s lens_stored = Kaydedildi -lens_empty = boş -lens_hint = Lensleri hareket ettirmek için bir kullanıcıya basın. Mesafeyi kaydetmek için basılı tutun. lens_move_failed = Lensler hareket ettirilemedi. lens_not_reached = Lensler mesafeye ulaşmadı. lens_store_failed = Mesafe kaydedilemedi. @@ -1324,10 +1749,45 @@ updates_start_failed = Güncelleyici başlatılamadı. updates_part_update = Sürüm updates_part_kernel = Çekirdek updates_part_packages = Sistemin paketleri +about_title = Hakkında +about_versions = Sürümler +about_system = Sistem +about_recovery = Recovery +about_packages = Paketler +about_kernel = Çekirdek +about_driver = Başlık sürücüsü +home_controllers_both = İki kumanda da bağlı +home_controller_missing = Bir kumanda bağlı değil +updates_update_to = %s sürümüne güncelle +updates_whats_new = Yenilikler +thumb_lr = Analog çubukla sola ve sağa +thumb_scroll = Kaydırmak için analog çubuk +lens_close_short = 62 mm'nin altında lensler burnunuza baskı yapabilir. +lens_closer = Yine de yaklaştır +lens_people = Kişiler +lens_hold = Kaydetmek için basılı tutun +controller_left_name = Sol kumanda +controller_right_name = Sağ kumanda +status_connected = Bağlı +status_missing = Bağlı değil +pair_listening = Tetiği ve PICO düğmesini basılı tutun · dinleniyor %s +hand_left = Sol +hand_right = Sağ +pair_title_left = Sol kumandayı eşleştir +pair_title_right = Sağ kumandayı eşleştir +pair_hold = İkisini de titreyene kadar yaklaşık 6 saniye basılı tutun. +key_trigger = Tetik +key_pico = PICO düğmesi +listening = Dinleniyor +pair_both = İki kumanda da bağlı +pair_next = Sıradaki: lens mesafesi. +step_of = Adım %s/%s +looks_sharp = Net görünüyor +continue_one = Tek kumandayla devam et +pair_can_point_left = Sol kumandanız artık işaret edebilir. +pair_can_point_right = Sağ kumandanız artık işaret edebilir. [arabic] -setup_welcome = لنُعدّ نظارة PICO 4: اللغة والمنطقة الزمنية وشبكة Wi-Fi ووحدات التحكم والعدسات. -setup_welcome_point = وجّه وحدة تحكم نحو «متابعة» واضغط على زنادها. setup_language_note = سيبدأ Steam بهذه اللغة. setup_timezone_note = تستخدم ساعة النظارة وSteam هذه المنطقة الزمنية. setup_timezone_failed = تعذّر ضبط المنطقة الزمنية. @@ -1337,31 +1797,17 @@ setup_wifi_later = يمكنك أيضًا الاتصال بشبكة لاحقًا setup_ipd_title = المسافة بين العدستين setup_ipd_text = حرّك العدستين حتى تصبح الصورة واضحة ومريحة. setup_ipd_range = تدعم PICO 4 من 58 إلى 72 مم. -lens_close_warning = دون 62 مم قد تضغط العدستان على أنفك. ضع علامة هنا لتقبل ذلك، ثم قرّبهما بحذر. setup_ready_title = جاهز لـ Steam setup_ready_text = يبدأ Steam عند اختيار «%s». سجّل الدخول هناك. -skip = تخطٍّ close = إغلاق pair = إقران controllers_title = وحدات التحكم controllers_both = تتصل وحدتا التحكم بالنظارة تلقائيًا عند تشغيلهما. -controller_left = وحدة التحكم اليسرى: %s -controller_right = وحدة التحكم اليمنى: %s -controller_connected = متصلة -controller_waiting = بانتظارها -controller_missing = غير متصلة -controller_pair_left = لإقران وحدة التحكم اليسرى: -controller_pair_right = لإقران وحدة التحكم اليمنى: -controller_pair_how = اضغط مع الاستمرار على زنادها وزر PICO معًا لمدة 6 ثوانٍ تقريبًا. -controller_point_left = وجّه وحدة التحكم الأخرى نحو «إقران» لإقران اليسرى. -controller_point_right = وجّه وحدة التحكم الأخرى نحو «إقران» لإقران اليمنى. controller_pair_failed = لم يتم إقران أي وحدة تحكم. حاول مرة أخرى باستخدام «إقران». controller_radio = راديو وحدات التحكم غير جاهز بعد. settings_title = إعدادات Overpressure lens_preset = المستخدم %s lens_stored = تم الحفظ -lens_empty = فارغ -lens_hint = اضغط على مستخدم لتحريك العدسات. اضغط مطولًا لحفظ المسافة. lens_move_failed = تعذّر تحريك العدسات. lens_not_reached = لم تصل العدسات إلى المسافة. lens_store_failed = تعذّر حفظ المسافة. @@ -1384,10 +1830,45 @@ updates_start_failed = تعذّر بدء أداة التحديث. updates_part_update = الإصدار updates_part_kernel = النواة updates_part_packages = حزم النظام +about_title = حول +about_versions = الإصدارات +about_system = النظام +about_recovery = Recovery +about_packages = الحزم +about_kernel = النواة +about_driver = برنامج تشغيل النظارة +home_controllers_both = وحدتا التحكم متصلتان +home_controller_missing = إحدى وحدتي التحكم غير متصلة +updates_update_to = التحديث إلى %s +updates_whats_new = الجديد +thumb_lr = عصا التحكم يسارًا ويمينًا +thumb_scroll = عصا التحكم للتمرير +lens_close_short = تحت 62 مم قد تضغط العدستان على أنفك. +lens_closer = تقريب على أي حال +lens_people = الأشخاص +lens_hold = اضغط مطولًا للحفظ +controller_left_name = وحدة التحكم اليسرى +controller_right_name = وحدة التحكم اليمنى +status_connected = متصلة +status_missing = غير متصلة +pair_listening = اضغط مع الاستمرار على الزناد وزر PICO · جارٍ الاستماع %s +hand_left = اليسرى +hand_right = اليمنى +pair_title_left = إقران وحدة التحكم اليسرى +pair_title_right = إقران وحدة التحكم اليمنى +pair_hold = اضغط على الاثنين نحو 6 ثوانٍ حتى تهتز. +key_trigger = الزناد +key_pico = زر PICO +listening = جارٍ الاستماع +pair_both = وحدتا التحكم متصلتان +pair_next = التالي: المسافة بين العدستين. +step_of = الخطوة %s من %s +looks_sharp = الصورة واضحة +continue_one = المتابعة بوحدة واحدة +pair_can_point_left = يمكنك الآن التأشير بوحدة التحكم اليسرى. +pair_can_point_right = يمكنك الآن التأشير بوحدة التحكم اليمنى. [japanese] -setup_welcome = PICO 4 をセットアップしましょう:言語、タイムゾーン、Wi-Fi、コントローラー、レンズ。 -setup_welcome_point = コントローラーを「続行」に向けて、トリガーを引いてください。 setup_language_note = Steam はこの言語で起動します。 setup_timezone_note = ヘッドセットの時計と Steam はこのタイムゾーンを使います。 setup_timezone_failed = タイムゾーンを設定できませんでした。 @@ -1397,31 +1878,17 @@ setup_wifi_later = ネットワークには、あとから Steam の設定で接 setup_ipd_title = レンズの間隔 setup_ipd_text = 映像がくっきり快適に見えるまでレンズを動かしてください。 setup_ipd_range = PICO 4 は 58~72 mm に対応しています。 -lens_close_warning = 62 mm より狭くすると、レンズが鼻に当たることがあります。了承する場合はここにチェックを入れ、慎重に近づけてください。 setup_ready_title = Steam の準備完了 setup_ready_text = 「%s」を選ぶと Steam が起動します。そこでサインインしてください。 -skip = スキップ close = 閉じる pair = ペアリング controllers_title = コントローラー controllers_both = 電源が入っていれば、2 台のコントローラーは自動でヘッドセットに接続します。 -controller_left = 左コントローラー:%s -controller_right = 右コントローラー:%s -controller_connected = 接続済み -controller_waiting = 待機中 -controller_missing = 未接続 -controller_pair_left = 左コントローラーをペアリングするには: -controller_pair_right = 右コントローラーをペアリングするには: -controller_pair_how = トリガーと PICO ボタンを同時に約 6 秒間押し続けてください。 -controller_point_left = もう一方のコントローラーを「ペアリング」に向けて、左をペアリングします。 -controller_point_right = もう一方のコントローラーを「ペアリング」に向けて、右をペアリングします。 controller_pair_failed = コントローラーはペアリングされませんでした。「ペアリング」でもう一度お試しください。 controller_radio = コントローラーの無線はまだ準備ができていません。 settings_title = Overpressure 設定 lens_preset = ユーザー %s lens_stored = 保存しました -lens_empty = 空 -lens_hint = ユーザーを押すとレンズが動きます。長押しすると間隔を保存します。 lens_move_failed = レンズを動かせませんでした。 lens_not_reached = レンズがその間隔に届きませんでした。 lens_store_failed = 間隔を保存できませんでした。 @@ -1444,10 +1911,45 @@ updates_start_failed = アップデーターを開始できませんでした。 updates_part_update = リリース updates_part_kernel = カーネル updates_part_packages = システムのパッケージ +about_title = 情報 +about_versions = バージョン +about_system = システム +about_recovery = Recovery +about_packages = パッケージ +about_kernel = カーネル +about_driver = ヘッドセットドライバー +home_controllers_both = 両方のコントローラーが接続済み +home_controller_missing = コントローラーが 1 台接続されていません +updates_update_to = %s にアップデート +updates_whats_new = 新機能 +thumb_lr = スティックを左右に +thumb_scroll = スティックでスクロール +lens_close_short = 62 mm 未満では、レンズが鼻に当たることがあります。 +lens_closer = それでも近づける +lens_people = ユーザー +lens_hold = 長押しで保存 +controller_left_name = 左コントローラー +controller_right_name = 右コントローラー +status_connected = 接続済み +status_missing = 未接続 +pair_listening = トリガーと PICO ボタンを長押し · 待機中 %s +hand_left = 左 +hand_right = 右 +pair_title_left = 左コントローラーをペアリング +pair_title_right = 右コントローラーをペアリング +pair_hold = 振動するまで、両方を約 6 秒間押し続けてください。 +key_trigger = トリガー +key_pico = PICO ボタン +listening = 待機中 +pair_both = 両方のコントローラーが接続されました +pair_next = 次は、レンズの間隔です。 +step_of = ステップ %s/%s +looks_sharp = くっきり見える +continue_one = 1 台で続ける +pair_can_point_left = 左コントローラーでポイントできるようになりました。 +pair_can_point_right = 右コントローラーでポイントできるようになりました。 [koreana] -setup_welcome = PICO 4를 설정해 보겠습니다: 언어, 시간대, Wi-Fi, 컨트롤러, 렌즈. -setup_welcome_point = 컨트롤러로 "계속"을 가리키고 트리거를 당기세요. setup_language_note = Steam이 이 언어로 시작됩니다. setup_timezone_note = 헤드셋의 시계와 Steam은 이 시간대를 사용합니다. setup_timezone_failed = 시간대를 설정할 수 없습니다. @@ -1457,31 +1959,17 @@ setup_wifi_later = 네트워크는 나중에 Steam 설정에서도 연결할 수 setup_ipd_title = 렌즈 간격 setup_ipd_text = 화면이 선명하고 편안해질 때까지 렌즈를 움직이세요. setup_ipd_range = PICO 4는 58~72mm를 지원합니다. -lens_close_warning = 62mm보다 좁히면 렌즈가 코를 누를 수 있습니다. 이를 받아들이려면 여기를 체크한 뒤 조심해서 좁히세요. setup_ready_title = Steam 준비 완료 setup_ready_text = "%s" 버튼을 선택하면 Steam이 시작됩니다. 그곳에서 로그인하세요. -skip = 건너뛰기 close = 닫기 pair = 페어링 controllers_title = 컨트롤러 controllers_both = 두 컨트롤러 모두 켜져 있으면 헤드셋에 자동으로 연결됩니다. -controller_left = 왼쪽 컨트롤러: %s -controller_right = 오른쪽 컨트롤러: %s -controller_connected = 연결됨 -controller_waiting = 기다리는 중 -controller_missing = 연결 안 됨 -controller_pair_left = 왼쪽 컨트롤러를 페어링하려면: -controller_pair_right = 오른쪽 컨트롤러를 페어링하려면: -controller_pair_how = 트리거와 PICO 버튼을 동시에 약 6초간 누르고 계세요. -controller_point_left = 다른 컨트롤러로 "페어링"을 가리켜 왼쪽을 페어링하세요. -controller_point_right = 다른 컨트롤러로 "페어링"을 가리켜 오른쪽을 페어링하세요. controller_pair_failed = 페어링된 컨트롤러가 없습니다. "페어링"으로 다시 시도하세요. controller_radio = 컨트롤러 무선이 아직 준비되지 않았습니다. settings_title = Overpressure 설정 lens_preset = 사용자 %s lens_stored = 저장됨 -lens_empty = 비어 있음 -lens_hint = 사용자를 누르면 렌즈가 움직입니다. 길게 누르면 간격을 저장합니다. lens_move_failed = 렌즈를 움직이지 못했습니다. lens_not_reached = 렌즈가 그 간격에 도달하지 못했습니다. lens_store_failed = 간격을 저장하지 못했습니다. @@ -1504,10 +1992,45 @@ updates_start_failed = 업데이트 프로그램을 시작할 수 없습니다. updates_part_update = 릴리스 updates_part_kernel = 커널 updates_part_packages = 시스템 패키지 +about_title = 정보 +about_versions = 버전 +about_system = 시스템 +about_recovery = Recovery +about_packages = 패키지 +about_kernel = 커널 +about_driver = 헤드셋 드라이버 +home_controllers_both = 두 컨트롤러 모두 연결됨 +home_controller_missing = 컨트롤러 하나가 연결되지 않음 +updates_update_to = %s(으)로 업데이트 +updates_whats_new = 새로운 기능 +thumb_lr = 썸스틱 좌우 +thumb_scroll = 썸스틱으로 스크롤 +lens_close_short = 62mm보다 가까우면 렌즈가 코를 누를 수 있습니다. +lens_closer = 그래도 더 가깝게 +lens_people = 사용자 +lens_hold = 길게 눌러 저장 +controller_left_name = 왼쪽 컨트롤러 +controller_right_name = 오른쪽 컨트롤러 +status_connected = 연결됨 +status_missing = 연결 안 됨 +pair_listening = 트리거와 PICO 버튼을 길게 누르세요 · 대기 중 %s +hand_left = 왼쪽 +hand_right = 오른쪽 +pair_title_left = 왼쪽 컨트롤러 페어링 +pair_title_right = 오른쪽 컨트롤러 페어링 +pair_hold = 진동할 때까지 두 버튼을 약 6초간 누르세요. +key_trigger = 트리거 +key_pico = PICO 버튼 +listening = 대기 중 +pair_both = 두 컨트롤러가 모두 연결되었습니다 +pair_next = 다음: 렌즈 간격. +step_of = %s/%s단계 +looks_sharp = 선명합니다 +continue_one = 하나로 계속 +pair_can_point_left = 이제 왼쪽 컨트롤러로 가리킬 수 있습니다. +pair_can_point_right = 이제 오른쪽 컨트롤러로 가리킬 수 있습니다. [schinese] -setup_welcome = 让我们来设置 PICO 4:语言、时区、Wi-Fi、手柄和镜片。 -setup_welcome_point = 将手柄指向“继续”,然后扣动扳机。 setup_language_note = Steam 将以此语言启动。 setup_timezone_note = 头显的时钟和 Steam 使用此时区。 setup_timezone_failed = 无法设置时区。 @@ -1517,31 +2040,17 @@ setup_wifi_later = 你也可以稍后在 Steam 设置中连接网络。 setup_ipd_title = 镜片间距 setup_ipd_text = 移动镜片,直到画面清晰舒适。 setup_ipd_range = PICO 4 支持 58 至 72 毫米。 -lens_close_warning = 小于 62 毫米时,镜片可能会压到鼻子。勾选此处表示接受,然后请小心地调近。 setup_ready_title = 准备进入 Steam setup_ready_text = 选择“%s”后 Steam 将启动。请在其中登录。 -skip = 跳过 close = 关闭 pair = 配对 controllers_title = 手柄 controllers_both = 两个手柄开启后会自动连接头显。 -controller_left = 左手柄:%s -controller_right = 右手柄:%s -controller_connected = 已连接 -controller_waiting = 等待中 -controller_missing = 未连接 -controller_pair_left = 配对左手柄: -controller_pair_right = 配对右手柄: -controller_pair_how = 同时按住扳机和 PICO 键约 6 秒。 -controller_point_left = 用另一个手柄指向“配对”来配对左手柄。 -controller_point_right = 用另一个手柄指向“配对”来配对右手柄。 controller_pair_failed = 没有配对任何手柄。请用“配对”重试。 controller_radio = 手柄无线模块尚未就绪。 settings_title = Overpressure 设置 lens_preset = 用户 %s lens_stored = 已保存 -lens_empty = 空 -lens_hint = 按下一个用户即可移动镜片。长按可保存间距。 lens_move_failed = 无法移动镜片。 lens_not_reached = 镜片未到达该间距。 lens_store_failed = 无法保存间距。 @@ -1564,10 +2073,45 @@ updates_start_failed = 无法启动更新程序。 updates_part_update = 版本 updates_part_kernel = 内核 updates_part_packages = 系统软件包 +about_title = 关于 +about_versions = 版本 +about_system = 系统 +about_recovery = Recovery +about_packages = 软件包 +about_kernel = 内核 +about_driver = 头显驱动 +home_controllers_both = 两个手柄均已连接 +home_controller_missing = 有一个手柄未连接 +updates_update_to = 更新到 %s +updates_whats_new = 新功能 +thumb_lr = 摇杆左右拨动 +thumb_scroll = 用摇杆滚动 +lens_close_short = 小于 62 毫米时,镜片可能会压到鼻子。 +lens_closer = 仍要调近 +lens_people = 用户 +lens_hold = 长按保存 +controller_left_name = 左手柄 +controller_right_name = 右手柄 +status_connected = 已连接 +status_missing = 未连接 +pair_listening = 按住扳机键和 PICO 键 · 正在等待 %s +hand_left = 左 +hand_right = 右 +pair_title_left = 配对左手柄 +pair_title_right = 配对右手柄 +pair_hold = 同时按住两键约 6 秒,直到手柄振动。 +key_trigger = 扳机键 +key_pico = PICO 键 +listening = 正在等待 +pair_both = 两个手柄均已连接 +pair_next = 下一步:镜片间距。 +step_of = 第 %s 步,共 %s 步 +looks_sharp = 已清晰 +continue_one = 用一个手柄继续 +pair_can_point_left = 你的左手柄现在可以指向了。 +pair_can_point_right = 你的右手柄现在可以指向了。 [tchinese] -setup_welcome = 讓我們設定 PICO 4:語言、時區、Wi-Fi、控制器和鏡片。 -setup_welcome_point = 將控制器指向「繼續」,然後扣下扳機。 setup_language_note = Steam 將以此語言啟動。 setup_timezone_note = 頭戴裝置的時鐘和 Steam 會使用此時區。 setup_timezone_failed = 無法設定時區。 @@ -1577,31 +2121,17 @@ setup_wifi_later = 你也可以稍後在 Steam 設定中連線至網路。 setup_ipd_title = 鏡片間距 setup_ipd_text = 移動鏡片,直到畫面清晰舒適。 setup_ipd_range = PICO 4 支援 58 至 72 公釐。 -lens_close_warning = 小於 62 公釐時,鏡片可能會壓到鼻子。勾選此處表示接受,然後請小心地調近。 setup_ready_title = 準備進入 Steam setup_ready_text = 選擇「%s」後 Steam 將會啟動。請在其中登入。 -skip = 略過 close = 關閉 pair = 配對 controllers_title = 控制器 controllers_both = 兩支控制器開啟後會自動連線至頭戴裝置。 -controller_left = 左控制器:%s -controller_right = 右控制器:%s -controller_connected = 已連線 -controller_waiting = 等待中 -controller_missing = 未連線 -controller_pair_left = 配對左控制器: -controller_pair_right = 配對右控制器: -controller_pair_how = 同時按住扳機和 PICO 鍵約 6 秒。 -controller_point_left = 用另一支控制器指向「配對」來配對左控制器。 -controller_point_right = 用另一支控制器指向「配對」來配對右控制器。 controller_pair_failed = 沒有配對任何控制器。請用「配對」再試一次。 controller_radio = 控制器的無線模組尚未就緒。 settings_title = Overpressure 設定 lens_preset = 使用者 %s lens_stored = 已儲存 -lens_empty = 空 -lens_hint = 按下一位使用者即可移動鏡片。長按可儲存間距。 lens_move_failed = 無法移動鏡片。 lens_not_reached = 鏡片未到達該間距。 lens_store_failed = 無法儲存間距。 @@ -1624,10 +2154,45 @@ updates_start_failed = 無法啟動更新程式。 updates_part_update = 版本 updates_part_kernel = 核心 updates_part_packages = 系統套件 +about_title = 關於 +about_versions = 版本 +about_system = 系統 +about_recovery = Recovery +about_packages = 套件 +about_kernel = 核心 +about_driver = 頭戴裝置驅動程式 +home_controllers_both = 兩支控制器皆已連線 +home_controller_missing = 有一支控制器未連線 +updates_update_to = 更新至 %s +updates_whats_new = 新功能 +thumb_lr = 搖桿左右撥動 +thumb_scroll = 用搖桿捲動 +lens_close_short = 小於 62 公釐時,鏡片可能會壓到鼻子。 +lens_closer = 仍要調近 +lens_people = 使用者 +lens_hold = 長按以儲存 +controller_left_name = 左控制器 +controller_right_name = 右控制器 +status_connected = 已連線 +status_missing = 未連線 +pair_listening = 按住扳機鍵與 PICO 鍵 · 正在等待 %s +hand_left = 左 +hand_right = 右 +pair_title_left = 配對左控制器 +pair_title_right = 配對右控制器 +pair_hold = 同時按住兩鍵約 6 秒,直到控制器震動。 +key_trigger = 扳機鍵 +key_pico = PICO 鍵 +listening = 正在等待 +pair_both = 兩支控制器皆已連線 +pair_next = 下一步:鏡片間距。 +step_of = 第 %s 步,共 %s 步 +looks_sharp = 已清晰 +continue_one = 以一支控制器繼續 +pair_can_point_left = 你的左控制器現在可以指向了。 +pair_can_point_right = 你的右控制器現在可以指向了。 [thai] -setup_welcome = มาตั้งค่า PICO 4 กัน: ภาษา เขตเวลา Wi-Fi คอนโทรลเลอร์ และเลนส์ -setup_welcome_point = ชี้คอนโทรลเลอร์ไปที่ "ดำเนินการต่อ" แล้วกดไกปืน setup_language_note = Steam จะเริ่มในภาษานี้ setup_timezone_note = นาฬิกาของแว่นและ Steam ใช้เขตเวลานี้ setup_timezone_failed = ไม่สามารถตั้งค่าเขตเวลาได้ @@ -1637,31 +2202,17 @@ setup_wifi_later = คุณยังเชื่อมต่อเครือ setup_ipd_title = ระยะห่างเลนส์ setup_ipd_text = เลื่อนเลนส์จนภาพคมชัดและสบายตา setup_ipd_range = PICO 4 รองรับ 58 ถึง 72 มม. -lens_close_warning = ต่ำกว่า 62 มม. เลนส์อาจกดทับจมูกได้ ทำเครื่องหมายที่นี่เพื่อยอมรับ แล้วค่อย ๆ ปรับให้ใกล้ขึ้นอย่างระมัดระวัง setup_ready_title = พร้อมสำหรับ Steam setup_ready_text = Steam จะเริ่มเมื่อคุณเลือก "%s" ลงชื่อเข้าใช้ที่นั่น -skip = ข้าม close = ปิด pair = จับคู่ controllers_title = คอนโทรลเลอร์ controllers_both = คอนโทรลเลอร์ทั้งสองจะเชื่อมต่อกับแว่นเองเมื่อเปิดอยู่ -controller_left = คอนโทรลเลอร์ซ้าย: %s -controller_right = คอนโทรลเลอร์ขวา: %s -controller_connected = เชื่อมต่อแล้ว -controller_waiting = กำลังรอ -controller_missing = ไม่ได้เชื่อมต่อ -controller_pair_left = วิธีจับคู่คอนโทรลเลอร์ซ้าย: -controller_pair_right = วิธีจับคู่คอนโทรลเลอร์ขวา: -controller_pair_how = กดไกปืนและปุ่ม PICO ค้างไว้พร้อมกันประมาณ 6 วินาที -controller_point_left = ชี้คอนโทรลเลอร์อีกอันไปที่ "จับคู่" เพื่อจับคู่อันซ้าย -controller_point_right = ชี้คอนโทรลเลอร์อีกอันไปที่ "จับคู่" เพื่อจับคู่อันขวา controller_pair_failed = ไม่มีคอนโทรลเลอร์ที่จับคู่ ลองอีกครั้งด้วย "จับคู่" controller_radio = วิทยุของคอนโทรลเลอร์ยังไม่พร้อม settings_title = การตั้งค่า Overpressure lens_preset = ผู้ใช้ %s lens_stored = บันทึกแล้ว -lens_empty = ว่าง -lens_hint = กดผู้ใช้เพื่อขยับเลนส์ กดค้างไว้เพื่อบันทึกระยะห่าง lens_move_failed = ขยับเลนส์ไม่ได้ lens_not_reached = เลนส์ไม่ถึงระยะห่างนั้น lens_store_failed = บันทึกระยะห่างไม่ได้ @@ -1684,10 +2235,45 @@ updates_start_failed = ไม่สามารถเริ่มตัวอั updates_part_update = รุ่น updates_part_kernel = เคอร์เนล updates_part_packages = แพ็กเกจของระบบ +about_title = เกี่ยวกับ +about_versions = เวอร์ชัน +about_system = ระบบ +about_recovery = Recovery +about_packages = แพ็กเกจ +about_kernel = เคอร์เนล +about_driver = ไดรเวอร์แว่น +home_controllers_both = เชื่อมต่อคอนโทรลเลอร์ทั้งสองแล้ว +home_controller_missing = คอนโทรลเลอร์หนึ่งตัวไม่ได้เชื่อมต่อ +updates_update_to = อัปเดตเป็น %s +updates_whats_new = มีอะไรใหม่ +thumb_lr = จอยสติ๊กซ้ายและขวา +thumb_scroll = ใช้จอยสติ๊กเพื่อเลื่อน +lens_close_short = หากใกล้กว่า 62 มม. เลนส์อาจกดจมูกของคุณ +lens_closer = ปรับให้ใกล้ขึ้นอยู่ดี +lens_people = ผู้ใช้ +lens_hold = กดค้างเพื่อบันทึก +controller_left_name = คอนโทรลเลอร์ซ้าย +controller_right_name = คอนโทรลเลอร์ขวา +status_connected = เชื่อมต่อแล้ว +status_missing = ไม่ได้เชื่อมต่อ +pair_listening = กดทริกเกอร์และปุ่ม PICO ค้างไว้ · กำลังรอ %s +hand_left = ซ้าย +hand_right = ขวา +pair_title_left = จับคู่คอนโทรลเลอร์ซ้าย +pair_title_right = จับคู่คอนโทรลเลอร์ขวา +pair_hold = กดทั้งสองค้างไว้ประมาณ 6 วินาทีจนกว่าจะสั่น +key_trigger = ทริกเกอร์ +key_pico = ปุ่ม PICO +listening = กำลังรอ +pair_both = คอนโทรลเลอร์ทั้งสองเชื่อมต่อแล้ว +pair_next = ถัดไป: ระยะห่างเลนส์ +step_of = ขั้นตอนที่ %s จาก %s +looks_sharp = ภาพคมชัดแล้ว +continue_one = ดำเนินการต่อด้วยตัวเดียว +pair_can_point_left = คอนโทรลเลอร์ซ้ายของคุณชี้ได้แล้ว +pair_can_point_right = คอนโทรลเลอร์ขวาของคุณชี้ได้แล้ว [vietnamese] -setup_welcome = Hãy thiết lập PICO 4: ngôn ngữ, múi giờ, Wi-Fi, tay cầm và thấu kính. -setup_welcome_point = Hướng một tay cầm vào "Tiếp tục" và bóp cò của nó. setup_language_note = Steam sẽ khởi động bằng ngôn ngữ này. setup_timezone_note = Đồng hồ của kính và Steam dùng múi giờ này. setup_timezone_failed = Không thể đặt múi giờ. @@ -1697,31 +2283,17 @@ setup_wifi_later = Bạn cũng có thể kết nối mạng sau trong phần cà setup_ipd_title = Khoảng cách thấu kính setup_ipd_text = Di chuyển thấu kính cho đến khi hình ảnh rõ nét và dễ chịu. setup_ipd_range = PICO 4 hỗ trợ từ 58 đến 72 mm. -lens_close_warning = Dưới 62 mm, ống kính có thể đè lên mũi bạn. Đánh dấu vào đây để chấp nhận, rồi chỉnh gần lại một cách cẩn thận. setup_ready_title = Sẵn sàng cho Steam setup_ready_text = Steam khởi động khi bạn chọn "%s". Hãy đăng nhập ở đó. -skip = Bỏ qua close = Đóng pair = Ghép đôi controllers_title = Tay cầm controllers_both = Cả hai tay cầm tự kết nối với kính khi được bật. -controller_left = Tay cầm trái: %s -controller_right = Tay cầm phải: %s -controller_connected = đã kết nối -controller_waiting = đang chờ -controller_missing = chưa kết nối -controller_pair_left = Để ghép đôi tay cầm trái: -controller_pair_right = Để ghép đôi tay cầm phải: -controller_pair_how = Giữ đồng thời cò và nút PICO của nó trong khoảng 6 giây. -controller_point_left = Hướng tay cầm còn lại vào "Ghép đôi" để ghép đôi tay trái. -controller_point_right = Hướng tay cầm còn lại vào "Ghép đôi" để ghép đôi tay phải. controller_pair_failed = Chưa ghép đôi được tay cầm nào. Hãy thử lại bằng "Ghép đôi". controller_radio = Bộ phát sóng của tay cầm chưa sẵn sàng. settings_title = Cài đặt Overpressure lens_preset = Người dùng %s lens_stored = Đã lưu -lens_empty = trống -lens_hint = Nhấn vào một người dùng để di chuyển thấu kính. Giữ để lưu khoảng cách. lens_move_failed = Không thể di chuyển thấu kính. lens_not_reached = Thấu kính chưa đạt tới khoảng cách. lens_store_failed = Không thể lưu khoảng cách. @@ -1744,10 +2316,45 @@ updates_start_failed = Không thể khởi động trình cập nhật. updates_part_update = Phiên bản updates_part_kernel = Nhân hệ thống updates_part_packages = Các gói của hệ thống +about_title = Giới thiệu +about_versions = Phiên bản +about_system = Hệ thống +about_recovery = Recovery +about_packages = Gói +about_kernel = Nhân +about_driver = Trình điều khiển kính +home_controllers_both = Cả hai tay cầm đã kết nối +home_controller_missing = Một tay cầm chưa kết nối +updates_update_to = Cập nhật lên %s +updates_whats_new = Có gì mới +thumb_lr = Gạt cần analog sang trái và phải +thumb_scroll = Dùng cần analog để cuộn +lens_close_short = Dưới 62 mm, thấu kính có thể đè lên mũi bạn. +lens_closer = Vẫn đưa gần hơn +lens_people = Người dùng +lens_hold = Giữ để lưu +controller_left_name = Tay cầm trái +controller_right_name = Tay cầm phải +status_connected = Đã kết nối +status_missing = Chưa kết nối +pair_listening = Giữ cò và nút PICO · đang chờ %s +hand_left = Trái +hand_right = Phải +pair_title_left = Ghép đôi tay cầm trái +pair_title_right = Ghép đôi tay cầm phải +pair_hold = Giữ cả hai khoảng 6 giây, cho đến khi tay cầm rung. +key_trigger = Cò +key_pico = Nút PICO +listening = Đang chờ +pair_both = Cả hai tay cầm đã được kết nối +pair_next = Tiếp theo: khoảng cách thấu kính. +step_of = Bước %s/%s +looks_sharp = Đã rõ nét +continue_one = Tiếp tục với một tay cầm +pair_can_point_left = Tay cầm trái của bạn giờ đã có thể trỏ. +pair_can_point_right = Tay cầm phải của bạn giờ đã có thể trỏ. [indonesian] -setup_welcome = Mari siapkan PICO 4 Anda: bahasa, zona waktu, Wi-Fi, kontroler, dan lensa. -setup_welcome_point = Arahkan kontroler ke "Lanjutkan" lalu tarik pelatuknya. setup_language_note = Steam akan dimulai dalam bahasa ini. setup_timezone_note = Jam headset dan Steam menggunakan zona waktu ini. setup_timezone_failed = Zona waktu tidak dapat diatur. @@ -1757,31 +2364,17 @@ setup_wifi_later = Anda juga dapat terhubung ke jaringan nanti di pengaturan Ste setup_ipd_title = Jarak lensa setup_ipd_text = Geser lensa sampai gambar tajam dan nyaman. setup_ipd_range = PICO 4 mendukung 58 hingga 72 mm. -lens_close_warning = Di bawah 62 mm, lensa dapat menekan hidung Anda. Centang di sini untuk menerimanya, lalu dekatkan dengan hati-hati. setup_ready_title = Siap untuk Steam setup_ready_text = Steam dimulai saat Anda memilih "%s". Masuk di sana. -skip = Lewati close = Tutup pair = Pasangkan controllers_title = Kontroler controllers_both = Kedua kontroler terhubung sendiri ke headset saat menyala. -controller_left = Kontroler kiri: %s -controller_right = Kontroler kanan: %s -controller_connected = terhubung -controller_waiting = menunggu -controller_missing = tidak terhubung -controller_pair_left = Untuk memasangkan kontroler kiri: -controller_pair_right = Untuk memasangkan kontroler kanan: -controller_pair_how = Tahan pelatuk dan tombol PICO-nya bersamaan selama sekitar 6 detik. -controller_point_left = Arahkan kontroler lainnya ke "Pasangkan" untuk memasangkan yang kiri. -controller_point_right = Arahkan kontroler lainnya ke "Pasangkan" untuk memasangkan yang kanan. controller_pair_failed = Tidak ada kontroler yang dipasangkan. Coba lagi dengan "Pasangkan". controller_radio = Radio kontroler belum siap. settings_title = Pengaturan Overpressure lens_preset = Pengguna %s lens_stored = Tersimpan -lens_empty = kosong -lens_hint = Tekan pengguna untuk menggeser lensa. Tahan untuk menyimpan jaraknya. lens_move_failed = Lensa tidak dapat digeser. lens_not_reached = Lensa tidak mencapai jarak tersebut. lens_store_failed = Jarak tidak dapat disimpan. @@ -1804,10 +2397,45 @@ updates_start_failed = Pembaru tidak dapat dimulai. updates_part_update = Rilis updates_part_kernel = Kernel updates_part_packages = Paket sistem +about_title = Tentang +about_versions = Versi +about_system = Sistem +about_recovery = Recovery +about_packages = Paket +about_kernel = Kernel +about_driver = Driver headset +home_controllers_both = Kedua kontroler terhubung +home_controller_missing = Satu kontroler tidak terhubung +updates_update_to = Perbarui ke %s +updates_whats_new = Yang baru +thumb_lr = Thumbstick ke kiri dan kanan +thumb_scroll = Thumbstick untuk menggulir +lens_close_short = Di bawah 62 mm, lensa bisa menekan hidung Anda. +lens_closer = Tetap dekatkan +lens_people = Pengguna +lens_hold = Tahan untuk menyimpan +controller_left_name = Kontroler kiri +controller_right_name = Kontroler kanan +status_connected = Terhubung +status_missing = Tidak terhubung +pair_listening = Tahan pemicu dan tombol PICO · mendengarkan %s +hand_left = Kiri +hand_right = Kanan +pair_title_left = Pasangkan kontroler kiri +pair_title_right = Pasangkan kontroler kanan +pair_hold = Tahan keduanya sekitar 6 detik, sampai bergetar. +key_trigger = Pemicu +key_pico = Tombol PICO +listening = Mendengarkan +pair_both = Kedua kontroler sudah terhubung +pair_next = Berikutnya: jarak lensa. +step_of = Langkah %s dari %s +looks_sharp = Sudah tajam +continue_one = Lanjut dengan satu +pair_can_point_left = Kontroler kiri Anda kini bisa menunjuk. +pair_can_point_right = Kontroler kanan Anda kini bisa menunjuk. [malay] -setup_welcome = Mari sediakan PICO 4 anda: bahasa, zon waktu, Wi-Fi, pengawal dan kanta. -setup_welcome_point = Halakan pengawal ke "Teruskan" dan tarik picunya. setup_language_note = Steam akan bermula dalam bahasa ini. setup_timezone_note = Jam set kepala dan Steam menggunakan zon waktu ini. setup_timezone_failed = Zon waktu tidak dapat ditetapkan. @@ -1817,31 +2445,17 @@ setup_wifi_later = Anda juga boleh menyambung ke rangkaian kemudian dalam tetapa setup_ipd_title = Jarak kanta setup_ipd_text = Gerakkan kanta sehingga gambar jelas dan selesa. setup_ipd_range = PICO 4 menyokong 58 hingga 72 mm. -lens_close_warning = Di bawah 62 mm, kanta boleh menekan hidung anda. Tandakan di sini untuk menerimanya, kemudian rapatkan dengan berhati-hati. setup_ready_title = Sedia untuk Steam setup_ready_text = Steam bermula apabila anda memilih "%s". Log masuk di sana. -skip = Langkau close = Tutup pair = Pasangkan controllers_title = Pengawal controllers_both = Kedua-dua pengawal menyambung sendiri ke set kepala apabila dihidupkan. -controller_left = Pengawal kiri: %s -controller_right = Pengawal kanan: %s -controller_connected = disambungkan -controller_waiting = menunggu -controller_missing = tidak disambungkan -controller_pair_left = Untuk memasangkan pengawal kiri: -controller_pair_right = Untuk memasangkan pengawal kanan: -controller_pair_how = Tahan picu dan butang PICO serentak selama kira-kira 6 saat. -controller_point_left = Halakan pengawal yang lain ke "Pasangkan" untuk memasangkan yang kiri. -controller_point_right = Halakan pengawal yang lain ke "Pasangkan" untuk memasangkan yang kanan. controller_pair_failed = Tiada pengawal dipasangkan. Cuba lagi dengan "Pasangkan". controller_radio = Radio pengawal belum sedia. settings_title = Tetapan Overpressure lens_preset = Pengguna %s lens_stored = Disimpan -lens_empty = kosong -lens_hint = Tekan pengguna untuk menggerakkan kanta. Tahan untuk menyimpan jaraknya. lens_move_failed = Kanta tidak dapat digerakkan. lens_not_reached = Kanta tidak mencapai jarak itu. lens_store_failed = Jarak tidak dapat disimpan. @@ -1864,3 +2478,40 @@ updates_start_failed = Pengemas kini tidak dapat dimulakan. updates_part_update = Keluaran updates_part_kernel = Kernel updates_part_packages = Pakej sistem +about_title = Perihal +about_versions = Versi +about_system = Sistem +about_recovery = Recovery +about_packages = Pakej +about_kernel = Kernel +about_driver = Pemacu set kepala +home_controllers_both = Kedua-dua pengawal disambungkan +home_controller_missing = Satu pengawal tidak disambungkan +updates_update_to = Kemas kini ke %s +updates_whats_new = Apa yang baharu +thumb_lr = Thumbstick ke kiri dan kanan +thumb_scroll = Thumbstick untuk menatal +lens_close_short = Di bawah 62 mm, kanta boleh menekan hidung anda. +lens_closer = Dekatkan juga +lens_people = Pengguna +lens_hold = Tahan untuk menyimpan +controller_left_name = Pengawal kiri +controller_right_name = Pengawal kanan +status_connected = Disambungkan +status_missing = Tidak disambungkan +pair_listening = Tahan picu dan butang PICO · mendengar %s +hand_left = Kiri +hand_right = Kanan +pair_title_left = Pasangkan pengawal kiri +pair_title_right = Pasangkan pengawal kanan +pair_hold = Tahan kedua-duanya kira-kira 6 saat, sehingga ia bergetar. +key_trigger = Picu +key_pico = Butang PICO +listening = Mendengar +pair_both = Kedua-dua pengawal sudah disambungkan +pair_next = Seterusnya: jarak kanta. +step_of = Langkah %s daripada %s +looks_sharp = Sudah jelas +continue_one = Teruskan dengan satu +pair_can_point_left = Pengawal kiri anda kini boleh menuding. +pair_can_point_right = Pengawal kanan anda kini boleh menuding. diff --git a/phoenix/pico4-monado/pico4_lens_panel.h b/phoenix/pico4-monado/pico4_lens_panel.h index b0d7472..501b9a9 100644 --- a/phoenix/pico4-monado/pico4_lens_panel.h +++ b/phoenix/pico4-monado/pico4_lens_panel.h @@ -1,16 +1,14 @@ // Copyright 2026, overpressure contributors. // SPDX-License-Identifier: BSL-1.0 /* - * Overpressure Settings' lens distance page: its layout and presets (overpressure-settings.cpp), - * apart from SteamVR and drawing so that the tests can reach them. + * Overpressure Settings' lens distance: PICO OS's range and its warning's gate, the slider's scale and + * the presets (overpressure-settings.cpp), apart from SteamVR and drawing so that the tests can reach them. */ #pragma once #include #include -#define PICO4_PANEL_W 800 -#define PICO4_PANEL_H 500 /* * PICO OS's range (its settings' lens distance): 58 to 72 mm, closer than 62 only once the warning's box * is ticked, which closing the page clears. The motor stops by itself at 59.4 to 59.9 mm. @@ -22,58 +20,6 @@ #define PICO4_PANEL_PRESETS 4 #define PICO4_PANEL_HOLD_S 1.0 //!< Holding a preset this long stores the separation in it. -enum pico4_panel_widget -{ - PICO4_PANEL_NONE = -1, - PICO4_PANEL_PRESET0 = 0, //!< ..PICO4_PANEL_PRESET0 + PICO4_PANEL_PRESETS - 1 - PICO4_PANEL_MINUS = PICO4_PANEL_PRESETS, - PICO4_PANEL_PLUS, - PICO4_PANEL_SLIDER, - PICO4_PANEL_WARNING, //!< The warning below 62 mm, in the presets' row while it shows: its box. -}; - -// In the panel's pixels, y down. -#define PICO4_PANEL_BUTTON_X0 30.0 //!< The minus button; the plus button mirrors it. -#define PICO4_PANEL_BUTTON_W 80.0 -#define PICO4_PANEL_SLIDER_X0 130.0 -#define PICO4_PANEL_SLIDER_X1 670.0 -#define PICO4_PANEL_ROW1_Y 190.0 -#define PICO4_PANEL_ROW1_H 80.0 -#define PICO4_PANEL_PRESET_X0 30.0 -#define PICO4_PANEL_PRESET_W 170.0 -#define PICO4_PANEL_PRESET_GAP 20.0 -#define PICO4_PANEL_ROW2_Y 310.0 -#define PICO4_PANEL_ROW2_H 110.0 - -//! What a press at (@p x, @p y) hits; while the @p warning shows, it takes the presets' row. -static inline enum pico4_panel_widget -pico4_panel_hit(double x, double y, bool warning) -{ - if (warning && y >= PICO4_PANEL_ROW2_Y && y < PICO4_PANEL_ROW2_Y + PICO4_PANEL_ROW2_H && x >= PICO4_PANEL_PRESET_X0 && - x < PICO4_PANEL_W - PICO4_PANEL_PRESET_X0) { - return PICO4_PANEL_WARNING; - } - if (y >= PICO4_PANEL_ROW1_Y && y < PICO4_PANEL_ROW1_Y + PICO4_PANEL_ROW1_H) { - if (x >= PICO4_PANEL_BUTTON_X0 && x < PICO4_PANEL_BUTTON_X0 + PICO4_PANEL_BUTTON_W) { - return PICO4_PANEL_MINUS; - } - if (x >= PICO4_PANEL_W - PICO4_PANEL_BUTTON_X0 - PICO4_PANEL_BUTTON_W && x < PICO4_PANEL_W - PICO4_PANEL_BUTTON_X0) { - return PICO4_PANEL_PLUS; - } - if (x >= PICO4_PANEL_SLIDER_X0 - 10 && x <= PICO4_PANEL_SLIDER_X1 + 10) { - return PICO4_PANEL_SLIDER; - } - } - if (y >= PICO4_PANEL_ROW2_Y && y < PICO4_PANEL_ROW2_Y + PICO4_PANEL_ROW2_H && x >= PICO4_PANEL_PRESET_X0) { - int i = (int)((x - PICO4_PANEL_PRESET_X0) / (PICO4_PANEL_PRESET_W + PICO4_PANEL_PRESET_GAP)); - double inside = x - PICO4_PANEL_PRESET_X0 - i * (PICO4_PANEL_PRESET_W + PICO4_PANEL_PRESET_GAP); - if (i < PICO4_PANEL_PRESETS && inside < PICO4_PANEL_PRESET_W) { - return (enum pico4_panel_widget)(PICO4_PANEL_PRESET0 + i); - } - } - return PICO4_PANEL_NONE; -} - static inline double pico4_panel_clamp(double mm) { @@ -103,20 +49,21 @@ pico4_panel_warning_after(bool shown, bool refused, double mm) return refused || (shown && mm <= PICO4_PANEL_MM_CLOSE); } -//! The slider's value at @p x, in steps of 0.1 mm. +//! The slider's value at @p x on a slider from @p x0 to @p x1, in steps of 0.1 mm. static inline double -pico4_panel_slider_mm(double x) +pico4_panel_slider_mm(double x, double x0, double x1) { - double t = (x - PICO4_PANEL_SLIDER_X0) / (PICO4_PANEL_SLIDER_X1 - PICO4_PANEL_SLIDER_X0); + double t = (x - x0) / (x1 - x0); int tenths = (int)(10 * (PICO4_PANEL_MM_MIN + t * (PICO4_PANEL_MM_MAX - PICO4_PANEL_MM_MIN)) + 0.5); return pico4_panel_clamp(tenths / 10.0); } +//! Where @p mm lies on a slider from @p x0 to @p x1. static inline double -pico4_panel_slider_x(double mm) +pico4_panel_slider_x(double mm, double x0, double x1) { double t = (pico4_panel_clamp(mm) - PICO4_PANEL_MM_MIN) / (PICO4_PANEL_MM_MAX - PICO4_PANEL_MM_MIN); - return PICO4_PANEL_SLIDER_X0 + t * (PICO4_PANEL_SLIDER_X1 - PICO4_PANEL_SLIDER_X0); + return x0 + t * (x1 - x0); } //! One separation in mm per line; a line outside the range, or a missing one, is an empty preset (0). diff --git a/phoenix/pico4-monado/pico4_onboarding.h b/phoenix/pico4-monado/pico4_onboarding.h index 54b4c84..dcc179f 100644 --- a/phoenix/pico4-monado/pico4_onboarding.h +++ b/phoenix/pico4-monado/pico4_onboarding.h @@ -1,49 +1,13 @@ // Copyright 2026, overpressure contributors. // SPDX-License-Identifier: BSL-1.0 /* - * The setup panel's size and its row of buttons (pico4-onboarding.cpp), apart from SteamVR and - * drawing so that the tests can reach them; its pages are in pico4_setup.h. + * The setup panel's size (pico4-onboarding.cpp); its pages are in pico4_setup.h, its look in + * pico4_ui.hpp, where each control registers its place as it is drawn. */ #pragma once -#include - #define PICO4_TOUR_W 1000 #define PICO4_TOUR_H 600 // The pages' texts, in every language, are in pico4-onboarding.strings; what to press to pair one // controller is PICO OS's instruction (its station service listens meanwhile). - -enum pico4_tour_button -{ - PICO4_TOUR_NONE = -1, - PICO4_TOUR_SKIP, - PICO4_TOUR_PAIR, //!< The middle button: Pair, Refresh, Turn on Wi-Fi. - PICO4_TOUR_NEXT, -}; - -// The buttons' row, in the page's pixels, y down. -#define PICO4_TOUR_BUTTON_Y 480.0 -#define PICO4_TOUR_BUTTON_H 80.0 -#define PICO4_TOUR_BUTTON_W 260.0 -#define PICO4_TOUR_SKIP_X 40.0 -#define PICO4_TOUR_PAIR_X 370.0 -#define PICO4_TOUR_NEXT_X 700.0 - -static inline enum pico4_tour_button -pico4_tour_hit(double x, double y, bool pair_shown) -{ - if (y < PICO4_TOUR_BUTTON_Y || y >= PICO4_TOUR_BUTTON_Y + PICO4_TOUR_BUTTON_H) { - return PICO4_TOUR_NONE; - } - if (x >= PICO4_TOUR_SKIP_X && x < PICO4_TOUR_SKIP_X + PICO4_TOUR_BUTTON_W) { - return PICO4_TOUR_SKIP; - } - if (pair_shown && x >= PICO4_TOUR_PAIR_X && x < PICO4_TOUR_PAIR_X + PICO4_TOUR_BUTTON_W) { - return PICO4_TOUR_PAIR; - } - if (x >= PICO4_TOUR_NEXT_X && x < PICO4_TOUR_NEXT_X + PICO4_TOUR_BUTTON_W) { - return PICO4_TOUR_NEXT; - } - return PICO4_TOUR_NONE; -} diff --git a/phoenix/pico4-monado/pico4_pair_ui.hpp b/phoenix/pico4-monado/pico4_pair_ui.hpp new file mode 100644 index 0000000..446abd2 --- /dev/null +++ b/phoenix/pico4-monado/pico4_pair_ui.hpp @@ -0,0 +1,104 @@ +// Copyright 2026, overpressure contributors. +// SPDX-License-Identifier: BSL-1.0 +/* + * Pairing a controller, as the setup's first step and Overpressure Settings' panel in front of the + * wearer show it: nothing to point at, since no controller can yet. The station listens by itself; + * the page says which hand, which two buttons (as icon chips) and for how long it listens, in large + * type that reads through lenses not yet set, and as few words as possible (no language is chosen + * yet in the setup). + */ +#pragma once + +#include "pico4_pairing.h" +#include "pico4_panels.hpp" +#include "pico4_ui.hpp" + +namespace pico4_pair_ui { + +using namespace pico4_ui; + +//! "m:ss" of @p seconds. +inline std::string +clock_text(int seconds) +{ + char out[16]; + snprintf(out, sizeof(out), "%d:%02d", seconds / 60, seconds % 60); + return out; +} + +struct Pairing +{ + bool known = false; //!< the driver said where the controllers are + bool left = false, right = false; + int pairing = 0; //!< the hand the station listens for: 1 left, 2 right + double listen_left = 0; //!< seconds it keeps listening + std::string message; //!< a failure, in red where the page's words are +}; + +//! The left and right pills on the top bar's right, as the driver reports them. +inline void +hand_pills(cairo_t *c, const Frame &f, const pico4_panels::Texts &t, const Pairing &p) +{ + const double mid = kTopbarH / 2; + double x = f.w - 32; + x -= pill(c, t.our("hand_right"), x, mid, p.right ? kGood : kNeutral, true) + 12; + pill(c, t.our("hand_left"), x, mid, p.left ? kGood : kNeutral, true); +} + +/*! + * The page below the top bar: both connected (a tick), or the hand to pair with its two buttons + * and the listening's time. @p with_footer leaves the footer's room at the bottom. + */ +inline void +content(cairo_t *c, const Frame &f, const pico4_panels::Texts &t, const Pairing &p, bool with_footer, + bool next_lenses) +{ + const double w = f.w, top = kTopbarH + (with_footer ? 24 : 48); + if (p.left && p.right) { + const double s = 104; + chip(c, kCheck, (w - s) / 2, top + 24, s, kGoodBg, kGoodText, true); + set(c, kText); + pico4_text::draw(c, t.our("pair_both"), 48, top + 160, w - 96, kH1, true, pico4_text::kCenter); + if (next_lenses) { + set(c, kMuted); + pico4_text::draw(c, t.our("pair_next"), 48, top + 222, w - 96, kBody, false, pico4_text::kCenter); + } + return; + } + const int hand = p.pairing != 0 ? p.pairing : (p.left ? 2 : 1); + set(c, kText); + pico4_text::draw(c, t.our(hand == 1 ? "pair_title_left" : "pair_title_right"), 48, top, w - 96, kH1, true, + pico4_text::kCenter); + set(c, kMuted); + pico4_text::draw(c, t.our("pair_hold"), 48, top + 62, w - 96, kBody, false, pico4_text::kCenter); + // The two buttons as chips with their names, a plus between them. + const double chip_s = 96, gap = 150, keys_y = top + 124, cx = w / 2; + const double lx = cx - gap / 2 - chip_s, rx = cx + gap / 2; + chip(c, kTrigger, lx, keys_y, chip_s, kSurface, kOrange); + chip(c, kButtonIcon, rx, keys_y, chip_s, kSurface, kOrange); + set(c, kMuted); + pico4_text::draw(c, "+", cx - 30, keys_y + chip_s / 2 - 26, 60, 40, false, pico4_text::kCenter); + set(c, kText); + pico4_text::draw(c, t.our("key_trigger"), lx - 60, keys_y + chip_s + 12, chip_s + 120, kButtonText, true, + pico4_text::kCenter); + pico4_text::draw(c, t.our("key_pico"), rx - 60, keys_y + chip_s + 12, chip_s + 120, kButtonText, true, + pico4_text::kCenter); + // Listening, and for how long; or why it does not. + const double row_y = keys_y + chip_s + 72, row_w = 560, rx0 = (w - row_w) / 2; + if (!p.message.empty()) { + set(c, kBadText); + pico4_text::draw(c, p.message, 48, row_y, w - 96, kSmall, false, pico4_text::kCenter); + } else if (p.pairing != 0) { + spinner(c, rx0 + 16, row_y + 16, 14, f.now); + const std::string listening = t.our("listening"); + const double lw = text_width(c, listening, kSmall, false); + line_mid(c, listening, rx0 + 44, row_y + 16, lw + 4, kSmall, false, kMuted); + const double bx = rx0 + 44 + lw + 20, bw = row_w - (bx - rx0) - 72; + bar(c, bx, row_y + 11, bw, p.listen_left / PICO4_PAIRING_LISTEN_S, f.now); + line_mid(c, clock_text((int)std::ceil(p.listen_left)), bx + bw + 16, row_y + 16, 64, kSmall, false, kText); + } else if (!p.known) { + spinner(c, w / 2, row_y + 16, 14, f.now); + } +} + +} // namespace pico4_pair_ui diff --git a/phoenix/pico4-monado/pico4_panels.hpp b/phoenix/pico4-monado/pico4_panels.hpp index 3b0e0e8..61e6e64 100644 --- a/phoenix/pico4-monado/pico4_panels.hpp +++ b/phoenix/pico4-monado/pico4_panels.hpp @@ -22,42 +22,6 @@ namespace pico4_panels { -/*! - * The warning below 62 mm in the box at (@p x, @p y, @p w, @p h): a check box, ticked when @p checked, and - * @p text beside it, as large as fits (as PICO OS's settings show it, the box in the warning itself). - */ -inline void -close_warning(cairo_t *c, const std::string &text, double x, double y, double w, double h, bool checked, bool pressed) -{ - pico4_overlay::rounded(c, x, y, w, h, 12); - cairo_set_source_rgb(c, pressed ? 0.42 : 0.34, pressed ? 0.30 : 0.24, 0.10); - cairo_fill(c); - const double box = 30, bx = x + 16, by = y + (h - box) / 2; - pico4_overlay::rounded(c, bx, by, box, box, 6); - if (checked) { - cairo_set_source_rgb(c, 0.96, 0.72, 0.26); - cairo_fill(c); - cairo_set_source_rgb(c, 0.13, 0.10, 0.04); - cairo_set_line_width(c, 4); - cairo_move_to(c, bx + 7, by + 16); - cairo_line_to(c, bx + 13, by + 22); - cairo_line_to(c, bx + 24, by + 9); - cairo_stroke(c); - } else { - cairo_set_source_rgb(c, 0.96, 0.72, 0.26); - cairo_set_line_width(c, 3); - cairo_stroke(c); - } - const double tx = bx + box + 16, tw = x + w - 16 - tx; - double size = 22; - while (size > 14 && pico4_text::draw(c, text, tx, 0, tw, size, false, pico4_text::kStart, true) > h - 12) { - size -= 1; - } - const double tall = pico4_text::draw(c, text, tx, 0, tw, size, false, pico4_text::kStart, true); - cairo_set_source_rgb(c, 0.98, 0.90, 0.74); - pico4_text::draw(c, text, tx, y + (h - tall) / 2, tw, size, false); -} - inline std::string home_path(const char *rest) { diff --git a/phoenix/pico4-monado/pico4_settings.h b/phoenix/pico4-monado/pico4_settings.h index c65dfaf..b4cc9a1 100644 --- a/phoenix/pico4-monado/pico4_settings.h +++ b/phoenix/pico4-monado/pico4_settings.h @@ -1,11 +1,11 @@ // Copyright 2026, overpressure contributors. // SPDX-License-Identifier: BSL-1.0 /* - * Overpressure Settings' layout and decisions (overpressure-settings.cpp), apart from SteamVR and - * drawing so that the tests can reach them: a menu on the left, the chosen page on the right. Its - * pages are what the PICO 4 cannot do the Steam Frame's way: the lenses have no wheel - * (pico4_lens_panel.h), SteamVR cannot pair its controllers, and its system updates come from - * overpressure's updater (overpressure-update) rather than Valve's. + * Overpressure Settings' decisions (overpressure-settings.cpp), apart from SteamVR and drawing so + * that the tests can reach them: its home and pages are what the PICO 4 cannot do the Steam Frame's + * way: the lenses have no wheel (pico4_lens_panel.h), SteamVR cannot pair its controllers, and the + * system's updates come from overpressure's updater (overpressure-update) rather than Valve's; and + * an About page with every part's version. */ #pragma once @@ -16,86 +16,23 @@ #include #include -// The whole tab, in its pixels, y down; a page is PICO4_PANEL_W x PICO4_PANEL_H from its origin. +// The whole tab, in its pixels, y down. #define PICO4_SETTINGS_W 1100 #define PICO4_SETTINGS_H 620 -#define PICO4_SETTINGS_MENU_W 300.0 -#define PICO4_SETTINGS_PAGE_X 300.0 -#define PICO4_SETTINGS_PAGE_Y 100.0 -#define PICO4_SETTINGS_TITLE_Y 30.0 //!< the page's title, above its origin +// The panel in front of the wearer for pairing. +#define PICO4_FRONT_W 800 +#define PICO4_FRONT_H 600 enum pico4_settings_page { - PICO4_SETTINGS_NONE = -1, + PICO4_SETTINGS_HOME, PICO4_SETTINGS_LENSES, PICO4_SETTINGS_CONTROLLERS, PICO4_SETTINGS_UPDATES, + PICO4_SETTINGS_ABOUT, PICO4_SETTINGS_PAGES, }; -// The menu's entries. -#define PICO4_SETTINGS_ENTRY_X 16.0 -#define PICO4_SETTINGS_ENTRY_W 268.0 -#define PICO4_SETTINGS_ENTRY_Y 110.0 -#define PICO4_SETTINGS_ENTRY_H 64.0 -#define PICO4_SETTINGS_ENTRY_STEP 76.0 - -//! The menu's entry at (@p x, @p y) of the tab. -static inline enum pico4_settings_page -pico4_settings_menu_hit(double x, double y) -{ - if (x < PICO4_SETTINGS_ENTRY_X || x >= PICO4_SETTINGS_ENTRY_X + PICO4_SETTINGS_ENTRY_W || y < PICO4_SETTINGS_ENTRY_Y) { - return PICO4_SETTINGS_NONE; - } - const int i = (int)((y - PICO4_SETTINGS_ENTRY_Y) / PICO4_SETTINGS_ENTRY_STEP); - const double inside = y - PICO4_SETTINGS_ENTRY_Y - i * PICO4_SETTINGS_ENTRY_STEP; - return i < PICO4_SETTINGS_PAGES && inside < PICO4_SETTINGS_ENTRY_H ? (enum pico4_settings_page)i : PICO4_SETTINGS_NONE; -} - -// The controllers' page, in the page's pixels from its 30 px margin: a row for each hand with its -// Pair button, the instructions under them, and on the panel in front of the wearer a Close button. -#define PICO4_CONTROLLERS_MARGIN 30.0 -#define PICO4_CONTROLLERS_W (PICO4_PANEL_W - 2 * PICO4_CONTROLLERS_MARGIN) -#define PICO4_CONTROLLERS_ROW_Y 0.0 -#define PICO4_CONTROLLERS_ROW_H 84.0 -#define PICO4_CONTROLLERS_ROW_STEP 100.0 -#define PICO4_CONTROLLERS_PAIR_X 548.0 -#define PICO4_CONTROLLERS_PAIR_W 180.0 -#define PICO4_CONTROLLERS_PAIR_INSET 12.0 -#define PICO4_CONTROLLERS_TEXT_Y 220.0 -#define PICO4_CONTROLLERS_CLOSE_Y 410.0 -#define PICO4_CONTROLLERS_CLOSE_H 70.0 - -enum pico4_controllers_widget -{ - PICO4_CONTROLLERS_NONE = -1, - PICO4_CONTROLLERS_PAIR_LEFT, - PICO4_CONTROLLERS_PAIR_RIGHT, - PICO4_CONTROLLERS_CLOSE, -}; - -/*! - * The widget at (@p x, @p y) of the controllers' page: a hand's Pair button only where it is - * shown (that controller missing, no pairing running), Close only on the panel in front. - */ -static inline enum pico4_controllers_widget -pico4_controllers_hit(double x, double y, bool pair_left, bool pair_right, bool close) -{ - if (x < PICO4_CONTROLLERS_PAIR_X || x >= PICO4_CONTROLLERS_PAIR_X + PICO4_CONTROLLERS_PAIR_W) { - return PICO4_CONTROLLERS_NONE; - } - for (int hand = 0; hand < 2; hand++) { - const double top = PICO4_CONTROLLERS_ROW_Y + hand * PICO4_CONTROLLERS_ROW_STEP + PICO4_CONTROLLERS_PAIR_INSET; - if ((hand == 0 ? pair_left : pair_right) && y >= top && y < top + PICO4_CONTROLLERS_ROW_H - 2 * PICO4_CONTROLLERS_PAIR_INSET) { - return hand == 0 ? PICO4_CONTROLLERS_PAIR_LEFT : PICO4_CONTROLLERS_PAIR_RIGHT; - } - } - if (close && y >= PICO4_CONTROLLERS_CLOSE_Y && y < PICO4_CONTROLLERS_CLOSE_Y + PICO4_CONTROLLERS_CLOSE_H) { - return PICO4_CONTROLLERS_CLOSE; - } - return PICO4_CONTROLLERS_NONE; -} - /*! * Whether the controllers' panel comes up in front of the wearer with the station listening * hands-free: no controller connected (as far as the driver said) and no pairing running, the @@ -134,15 +71,6 @@ struct pico4_updates long long time; //!< when the updater wrote it, in seconds since 1970 }; -// The page, in the page's pixels from its 30 px margin: the text from the top, a download's bar, -// and the button at the bottom right. -#define PICO4_UPDATES_MARGIN 30.0 -#define PICO4_UPDATES_W (PICO4_PANEL_W - 2 * PICO4_UPDATES_MARGIN) -#define PICO4_UPDATES_BUTTON_W 330.0 -#define PICO4_UPDATES_BUTTON_H 70.0 -#define PICO4_UPDATES_BUTTON_X (PICO4_UPDATES_W - PICO4_UPDATES_BUTTON_W) -#define PICO4_UPDATES_BUTTON_Y 400.0 - /*! * The JSON string whose text starts at @p p (after its opening quote) into @p out (@p size bytes), * its escapes decoded to UTF-8; false when it is cut off. Longer text is cut at @p size. @@ -357,10 +285,47 @@ pico4_updates_take(const struct pico4_updates *read, long long pressed, long lon return pressed == 0 || read->time >= pressed || now >= pressed + hold; } -//! Whether (@p x, @p y) of the updates' page is on its button, where it is @p shown. +/* + * The About page's versions: the image's version file (KEY=value lines, /usr/share//version) + * and pacman's database of the image's packages (a folder NAME-VERSION-RELEASE for each). + */ + +//! The value of @p key in KEY=value lines @p text into @p out; false without it. +static inline bool +pico4_about_value(const char *text, const char *key, char *out, size_t size) +{ + const size_t n = strlen(key); + for (const char *p = text; p != NULL && *p != '\0'; p = strchr(p, '\n'), p = p != NULL ? p + 1 : NULL) { + if (strncmp(p, key, n) == 0 && p[n] == '=') { + const char *v = p + n + 1, *end = strchr(v, '\n'); + size_t len = end != NULL ? (size_t)(end - v) : strlen(v); + if (len >= size) { + len = size - 1; + } + memcpy(out, v, len); + out[len] = '\0'; + return len > 0; + } + } + return false; +} + +/*! + * The version of package @p name from a pacman database folder's entry @p entry ("NAME-VERSION-RELEASE"), + * into @p out; false when the entry is another package's (a name that only starts like it). + */ static inline bool -pico4_updates_hit(double x, double y, bool shown) +pico4_about_package(const char *entry, const char *name, char *out, size_t size) { - return shown && x >= PICO4_UPDATES_BUTTON_X && x < PICO4_UPDATES_BUTTON_X + PICO4_UPDATES_BUTTON_W && - y >= PICO4_UPDATES_BUTTON_Y && y < PICO4_UPDATES_BUTTON_Y + PICO4_UPDATES_BUTTON_H; + const size_t n = strlen(name); + if (strncmp(entry, name, n) != 0 || entry[n] != '-') { + return false; + } + // The name may hold dashes itself: what follows must be VERSION-RELEASE, with exactly one more dash. + const char *version = entry + n + 1, *dash = strchr(version, '-'); + if (dash == NULL || dash == version || strchr(dash + 1, '-') != NULL || dash[1] == '\0') { + return false; + } + snprintf(out, size, "%s", version); + return true; } diff --git a/phoenix/pico4-monado/pico4_setup.h b/phoenix/pico4-monado/pico4_setup.h index d625566..c336270 100644 --- a/phoenix/pico4-monado/pico4_setup.h +++ b/phoenix/pico4-monado/pico4_setup.h @@ -7,8 +7,9 @@ * * Steam runs its own setup only on Valve's factory image; on an installed system with no saved * account it goes to the sign-in. These pages cover what its setup does, with the client's own - * words where it has them: the language and time zone it offers, the network, the controllers and - * the lens distance. + * words where it has them, in the order they can be done: first the controllers, hands-free (no + * laser can point before one is paired), then the lens distance, by the thumbstick (text may hurt + * to read before), then the language and time zone it offers, and the network. */ #pragma once @@ -21,12 +22,11 @@ enum pico4_setup_page { - PICO4_SETUP_WELCOME, + PICO4_SETUP_CONTROLLERS, + PICO4_SETUP_IPD, PICO4_SETUP_LANGUAGE, PICO4_SETUP_TIMEZONE, PICO4_SETUP_WIFI, - PICO4_SETUP_CONTROLLERS, - PICO4_SETUP_IPD, PICO4_SETUP_READY, PICO4_SETUP_PAGES, }; @@ -38,11 +38,21 @@ pico4_setup_next(enum pico4_setup_page page) return page + 1 < PICO4_SETUP_PAGES ? (enum pico4_setup_page)(page + 1) : PICO4_SETUP_PAGES; } -//! The page before @p page; the welcome page stays. +//! The page before @p page; the first stays. static inline enum pico4_setup_page pico4_setup_back(enum pico4_setup_page page) { - return page > PICO4_SETUP_WELCOME ? (enum pico4_setup_page)(page - 1) : PICO4_SETUP_WELCOME; + return page > PICO4_SETUP_CONTROLLERS ? (enum pico4_setup_page)(page - 1) : PICO4_SETUP_CONTROLLERS; +} + +/*! + * The page the setup opens on: the lens distance when both controllers are there already (paired + * before, switched on), else the pairing. + */ +static inline enum pico4_setup_page +pico4_setup_first(bool left, bool right) +{ + return left && right ? PICO4_SETUP_IPD : PICO4_SETUP_CONTROLLERS; } /*! @@ -219,78 +229,6 @@ pico4_setup_offset_text(int offset, char *out, size_t n) snprintf(out, n, "UTC%c%02d:%02d", offset < 0 ? '-' : '+', a / 100, a % 100); } -// -- Lists ------------------------------------------------------------------------------------------ - -//! Rows a list page shows. -#define PICO4_SETUP_ROWS 5 - -// The list's place on the 1000 x 600 page, y down: rows on the left, the page arrows on the right. -#define PICO4_SETUP_LIST_X 40.0 -#define PICO4_SETUP_LIST_Y 130.0 -#define PICO4_SETUP_LIST_W 820.0 -#define PICO4_SETUP_ROW_H 60.0 -#define PICO4_SETUP_ARROW_X 880.0 -#define PICO4_SETUP_ARROW_W 80.0 -#define PICO4_SETUP_ARROW_H 140.0 - -//! The row of the list's page at (@p x, @p y): 0 to PICO4_SETUP_ROWS - 1, or -1. -static inline int -pico4_setup_hit_row(double x, double y) -{ - if (x < PICO4_SETUP_LIST_X || x >= PICO4_SETUP_LIST_X + PICO4_SETUP_LIST_W || y < PICO4_SETUP_LIST_Y) { - return -1; - } - const int row = (int)((y - PICO4_SETUP_LIST_Y) / PICO4_SETUP_ROW_H); - return row < PICO4_SETUP_ROWS ? row : -1; -} - -//! The page arrow at (@p x, @p y): -1 up, 1 down, 0 none. -static inline int -pico4_setup_hit_arrow(double x, double y) -{ - if (x < PICO4_SETUP_ARROW_X || x >= PICO4_SETUP_ARROW_X + PICO4_SETUP_ARROW_W) { - return 0; - } - if (y >= PICO4_SETUP_LIST_Y && y < PICO4_SETUP_LIST_Y + PICO4_SETUP_ARROW_H) { - return -1; - } - const double down = PICO4_SETUP_LIST_Y + PICO4_SETUP_ROWS * PICO4_SETUP_ROW_H - PICO4_SETUP_ARROW_H; - return y >= down && y < down + PICO4_SETUP_ARROW_H ? 1 : 0; -} - -// The lens page's two buttons: closer and wider, either side of the distance. -#define PICO4_SETUP_IPD_Y 230.0 -#define PICO4_SETUP_IPD_H 120.0 -#define PICO4_SETUP_IPD_W 140.0 -#define PICO4_SETUP_IPD_LESS_X 180.0 -#define PICO4_SETUP_IPD_MORE_X 680.0 - -//! The lens button at (@p x, @p y): -1 closer, 1 wider, 0 none. -static inline int -pico4_setup_hit_ipd(double x, double y) -{ - if (y < PICO4_SETUP_IPD_Y || y >= PICO4_SETUP_IPD_Y + PICO4_SETUP_IPD_H) { - return 0; - } - if (x >= PICO4_SETUP_IPD_LESS_X && x < PICO4_SETUP_IPD_LESS_X + PICO4_SETUP_IPD_W) { - return -1; - } - return x >= PICO4_SETUP_IPD_MORE_X && x < PICO4_SETUP_IPD_MORE_X + PICO4_SETUP_IPD_W ? 1 : 0; -} - -// The warning below 62 mm under the buttons, in place of the range's line while it shows: its box. -#define PICO4_SETUP_WARNING_X 180.0 -#define PICO4_SETUP_WARNING_Y 362.0 -#define PICO4_SETUP_WARNING_W 640.0 -#define PICO4_SETUP_WARNING_H 70.0 - -static inline bool -pico4_setup_hit_warning(double x, double y) -{ - return x >= PICO4_SETUP_WARNING_X && x < PICO4_SETUP_WARNING_X + PICO4_SETUP_WARNING_W && y >= PICO4_SETUP_WARNING_Y && - y < PICO4_SETUP_WARNING_Y + PICO4_SETUP_WARNING_H; -} - /*! * The Steam client's interface language in its `registry.vdf` (@p vdf): the first `"language"` * value, into @p out; false when it has none (before the client's first start). @@ -318,29 +256,6 @@ pico4_setup_registry_language(const char *vdf, char *out, size_t n) return *p == '"' && k > 0; } -//! The page of rows that holds row @p index. -static inline int -pico4_setup_list_page(int index) -{ - return index < 0 ? 0 : index / PICO4_SETUP_ROWS; -} - -//! How many pages @p count rows take; at least one. -static inline int -pico4_setup_list_pages(int count) -{ - return count <= 0 ? 1 : (count + PICO4_SETUP_ROWS - 1) / PICO4_SETUP_ROWS; -} - -//! Page @p page moved by @p delta, kept within the list. -static inline int -pico4_setup_list_turn(int page, int delta, int count) -{ - int p = page + delta; - const int last = pico4_setup_list_pages(count) - 1; - return p < 0 ? 0 : p > last ? last : p; -} - // -- The lens distance -------------------------------------------------------------------------------- /* @@ -583,30 +498,6 @@ pico4_setup_text_chars(const char *text) return chars; } -// The input page's field, its show-password switch under it, and the attempt's sign. -#define PICO4_SETUP_FIELD_X 120.0 -#define PICO4_SETUP_FIELD_Y 170.0 -#define PICO4_SETUP_FIELD_W 760.0 -#define PICO4_SETUP_FIELD_H 80.0 -#define PICO4_SETUP_SHOW_Y 270.0 -#define PICO4_SETUP_SHOW_H 50.0 -#define PICO4_SETUP_SHOW_W 320.0 - -//! The field (1) or the show-password switch (2) at (@p x, @p y); 0 for neither. -static inline int -pico4_setup_hit_field(double x, double y) -{ - if (x >= PICO4_SETUP_FIELD_X && x < PICO4_SETUP_FIELD_X + PICO4_SETUP_FIELD_W && y >= PICO4_SETUP_FIELD_Y && - y < PICO4_SETUP_FIELD_Y + PICO4_SETUP_FIELD_H) { - return 1; - } - if (x >= PICO4_SETUP_FIELD_X && x < PICO4_SETUP_FIELD_X + PICO4_SETUP_SHOW_W && y >= PICO4_SETUP_SHOW_Y && - y < PICO4_SETUP_SHOW_Y + PICO4_SETUP_SHOW_H) { - return 2; - } - return 0; -} - // -- The Steam client's texts ------------------------------------------------------------------------- /*! diff --git a/phoenix/pico4-monado/pico4_ui.hpp b/phoenix/pico4-monado/pico4_ui.hpp new file mode 100644 index 0000000..e66fa94 --- /dev/null +++ b/phoenix/pico4-monado/pico4_ui.hpp @@ -0,0 +1,644 @@ +// Copyright 2026, overpressure contributors. +// SPDX-License-Identifier: BSL-1.0 +/* + * The panels' look (the setup and Overpressure Settings), after the overpressure client's: its colour + * tokens and its layout (a top bar with the way back, one column of grouped cards, rows that name a + * thing with its control on the right, tiles, pills), its sizes about 1.85 times for a panel at arm's + * length, and line icons drawn for overpressure on a 24 px grid. Every control registers where it is + * (pico4_ui_hits.h) and shows the laser's hover. + */ +#pragma once + +#include "pico4_overlay.hpp" +#include "pico4_text.hpp" +#include "pico4_ui_hits.h" + +#include + +#include +#include +#include +#include + +namespace pico4_ui { + +// -- Tokens: the client's (app.css, dark) ------------------------------------------------------------ + +struct Rgb +{ + double r, g, b; +}; + +constexpr Rgb +hex(unsigned v) +{ + return {((v >> 16) & 0xff) / 255.0, ((v >> 8) & 0xff) / 255.0, (v & 0xff) / 255.0}; +} + +constexpr Rgb kBg = hex(0x181a1f), kPanel = hex(0x202329), kSurface = hex(0x25282f), kLine = hex(0x343840); +constexpr Rgb kText = hex(0xe9eaed), kMuted = hex(0xa0a6b1), kBlue = hex(0x77a2ff), kHover = hex(0x292e37); +constexpr Rgb kInset = hex(0x14161a), kSelected = hex(0x26354f), kTrack = hex(0x3b4048), kButton = hex(0x353941); +constexpr Rgb kButtonHover = hex(0x414650), kPrimary = hex(0x346bdc), kPrimaryHover = hex(0x447cf0); +constexpr Rgb kPillBg = hex(0x373c44), kPillText = hex(0xd2d7de), kGoodBg = hex(0x203d32), kGoodText = hex(0x8ce4b5); +constexpr Rgb kUpdateBg = hex(0x483725), kUpdateText = hex(0xffc084), kUpdateLine = hex(0x7a5a35); +constexpr Rgb kBlueBg = hex(0x2c3e60), kBlueText = hex(0xb7ceff), kGreen = hex(0x44ce93), kOrange = hex(0xffb56b); +constexpr Rgb kWarnBg = hex(0x332a23), kWarnLine = hex(0x66513d), kWarnText = hex(0xe0c3a6), kWarnHeading = hex(0xffd09c); +constexpr Rgb kBadBg = hex(0x3a2326), kBadText = hex(0xffc9c4), kWhite = hex(0xffffff); +constexpr Rgb kScrollThumb = hex(0x5c6370); + +// Sizes, in the panel's pixels. +constexpr double kTopbarH = 80, kFooterH = 104, kSide = 48, kTopPad = 32; +constexpr double kButtonH = 72, kButtonR = 14, kGroupR = 22, kRowH = 80, kTileR = 22; +constexpr double kH1 = 40, kBody = 26, kSmall = 22, kLabel = 18, kTopText = 26, kButtonText = 24; + +inline void +set(cairo_t *c, Rgb k, double alpha = 1) +{ + cairo_set_source_rgba(c, k.r, k.g, k.b, alpha); +} + +inline void +fill_box(cairo_t *c, double x, double y, double w, double h, double r, Rgb k, double alpha = 1) +{ + pico4_overlay::rounded(c, x, y, w, h, r); + set(c, k, alpha); + cairo_fill(c); +} + +//! The laser's hover around a control: the client's focus ring. +inline void +hover_ring(cairo_t *c, double x, double y, double w, double h, double r) +{ + pico4_overlay::rounded(c, x - 4, y - 4, w + 8, h + 8, r + 4); + set(c, kBlue, 0.32); + cairo_set_line_width(c, 4); + cairo_stroke(c); +} + +// -- Icons -------------------------------------------------------------------------------------------- + +/* + * The line icons, as path data on a 24 px grid, 2 px clear of its edge: one stroke, round ends + * (out/drafts' contact sheet is where they were drawn and compared). + */ +enum Icon +{ + kRight, kLeft, kUp, kCheck, kDownload, kInfo, kAlert, kRefresh, kLock, kEye, kWifi, kController, kLenses, + kStick, kStickV, kTrigger, kButtonIcon, kPlay, kMinus, kPlus, kIcons, +}; + +inline const char * +icon_path(Icon i) +{ + static const char *const paths[kIcons] = { + "M9 5l7 7-7 7", + "M15 5l-7 7 7 7", + "M12 19V5M6 11l6-6 6 6", + "M4.5 12.5l5 5 10-10", + "M12 4v11M7 10l5 5 5-5M5 20h14", + "M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18ZM12 11v6M12 7.5v.01", + "M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18ZM12 7.5V13M12 16.5v.01", + "M20 12A8 8 0 1 1 17.66 6.34M20 3.5V8h-4.5", + "M6 11h12v9H6ZM8.5 11V8a3.5 3.5 0 0 1 7 0v3", + "M2.5 12C4.6 7.8 8 5.8 12 5.8s7.4 2 9.5 6.2c-2.1 4.2-5.5 6.2-9.5 6.2S4.6 16.2 2.5 12ZM12 9.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5Z", + "M2.5 9.5a14 14 0 0 1 19 0M5.5 13a9.5 9.5 0 0 1 13 0M8.8 16.3a4.6 4.6 0 0 1 6.4 0M12 19.8v.01", + "M7.5 7h9a4.5 4.5 0 0 1 4.5 4.5v3.2a3.3 3.3 0 0 1-5.9 2L13.7 15h-3.4l-1.4 1.7a3.3 3.3 0 0 1-5.9-2v-3.2A4.5 4.5 0 0 1 7.5 7ZM7.5 9.5v3.5M5.75 11.25h3.5M15.5 10.5v.01M17.5 12.5v.01", + "M6.5 5a4 4 0 1 0 0 8 4 4 0 0 0 0-8ZM17.5 5a4 4 0 1 0 0 8 4 4 0 0 0 0-8ZM10.5 9h3M4 19h16M6.5 16.5 4 19l2.5 2.5M17.5 16.5 20 19l-2.5 2.5", + "M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18ZM9.5 9 6.5 12l3 3M14.5 9l3 3-3 3", + "M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18ZM9 9.5l3-3 3 3M9 14.5l3 3 3-3", + "M4 5h16M8.5 5c0 6.5 2.5 11.5 7.5 14.5h1.5c-3.2-3.4-4.8-8.2-5-14.5", + "M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16ZM12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6Z", + "M8 5.5v13l10.5-6.5Z", + "M5 12h14", + "M12 5v14M5 12h14", + }; + return paths[i]; +} + +//! The next number of path data at @p p (spaces and commas skipped); false at a command or the end. +inline bool +path_number(const char *&p, double *out) +{ + while (*p == ' ' || *p == ',') { + p++; + } + if (!(*p == '-' || *p == '.' || (*p >= '0' && *p <= '9'))) { + return false; + } + char *end; + *out = strtod(p, &end); + if (end == p) { + return false; + } + p = end; + return true; +} + +//! An arc flag (0 or 1), which path data may write with no space after it. +inline bool +path_flag(const char *&p, double *out) +{ + while (*p == ' ' || *p == ',') { + p++; + } + if (*p != '0' && *p != '1') { + return false; + } + *out = *p == '1'; + p++; + return true; +} + +//! SVG's elliptical arc from the current point (@p x0, @p y0), as a circle's (the icons' arcs all are). +inline void +path_arc(cairo_t *c, double x0, double y0, double r, double large, double sweep, double x, double y) +{ + const double dx = (x0 - x) / 2, dy = (y0 - y) / 2, d2 = dx * dx + dy * dy; + if (d2 < 1e-12 || r <= 0) { + cairo_line_to(c, x, y); + return; + } + if (r * r < d2) { + r = std::sqrt(d2); // too small to reach: scaled up, as SVG does + } + const double k = std::sqrt(std::max(0.0, r * r - d2) / d2) * (large == sweep ? -1 : 1); + const double cx = k * dy + (x0 + x) / 2, cy = -k * dx + (y0 + y) / 2; + const double a0 = std::atan2(y0 - cy, x0 - cx), a1 = std::atan2(y - cy, x - cx); + if (sweep != 0) { + cairo_arc(c, cx, cy, r, a0, a1); + } else { + cairo_arc_negative(c, cx, cy, r, a0, a1); + } +} + +//! Path data @p d (M L H V C S A Z, absolute and relative) as cairo's current path. +inline void +path(cairo_t *c, const char *d) +{ + double x = 0, y = 0, sx = 0, sy = 0, cx2 = 0, cy2 = 0; + char cmd = 0, prev = 0; + const char *p = d; + while (*p != '\0') { + while (*p == ' ' || *p == ',') { + p++; + } + if (*p == '\0') { + break; + } + if ((*p >= 'A' && *p <= 'Z') || (*p >= 'a' && *p <= 'z')) { + cmd = *p++; + } + const bool rel = cmd >= 'a'; + const double ox = rel ? x : 0, oy = rel ? y : 0; + double v[7]; + switch (cmd | 0x20) { + case 'm': + if (!path_number(p, &v[0]) || !path_number(p, &v[1])) { + return; + } + x = ox + v[0], y = oy + v[1], sx = x, sy = y; + cairo_move_to(c, x, y); + cmd = rel ? 'l' : 'L'; // more pairs are lines + break; + case 'l': + if (!path_number(p, &v[0]) || !path_number(p, &v[1])) { + return; + } + x = ox + v[0], y = oy + v[1]; + cairo_line_to(c, x, y); + break; + case 'h': + if (!path_number(p, &v[0])) { + return; + } + x = ox + v[0]; + cairo_line_to(c, x, y); + break; + case 'v': + if (!path_number(p, &v[0])) { + return; + } + y = oy + v[0]; + cairo_line_to(c, x, y); + break; + case 'c': + for (int i = 0; i < 6; i++) { + if (!path_number(p, &v[i])) { + return; + } + } + cairo_curve_to(c, ox + v[0], oy + v[1], ox + v[2], oy + v[3], ox + v[4], oy + v[5]); + cx2 = ox + v[2], cy2 = oy + v[3], x = ox + v[4], y = oy + v[5]; + break; + case 's': { + for (int i = 0; i < 4; i++) { + if (!path_number(p, &v[i])) { + return; + } + } + const bool smooth = (prev | 0x20) == 'c' || (prev | 0x20) == 's'; + const double c1x = smooth ? 2 * x - cx2 : x, c1y = smooth ? 2 * y - cy2 : y; + cairo_curve_to(c, c1x, c1y, ox + v[0], oy + v[1], ox + v[2], oy + v[3]); + cx2 = ox + v[0], cy2 = oy + v[1], x = ox + v[2], y = oy + v[3]; + break; + } + case 'a': + if (!path_number(p, &v[0]) || !path_number(p, &v[1]) || !path_number(p, &v[2]) || !path_flag(p, &v[3]) || + !path_flag(p, &v[4]) || !path_number(p, &v[5]) || !path_number(p, &v[6])) { + return; + } + path_arc(c, x, y, v[0], v[3], v[4], ox + v[5], oy + v[6]); + x = ox + v[5], y = oy + v[6]; + break; + case 'z': + cairo_close_path(c); + x = sx, y = sy; + break; + default: return; // not path data + } + prev = cmd; + } +} + +//! Icon @p i, @p size px square, its top left at (@p x, @p y), in @p colour. +inline void +icon(cairo_t *c, Icon i, double x, double y, double size, Rgb colour) +{ + cairo_save(c); + cairo_new_path(c); + cairo_translate(c, x, y); + cairo_scale(c, size / 24.0, size / 24.0); + path(c, icon_path(i)); + cairo_restore(c); + set(c, colour); + cairo_set_line_width(c, 1.8 * size / 24.0 * (size < 32 ? 1.1 : 1.0)); + cairo_set_line_cap(c, CAIRO_LINE_CAP_ROUND); + cairo_set_line_join(c, CAIRO_LINE_JOIN_ROUND); + cairo_stroke(c); + cairo_new_path(c); +} + +// -- Text ---------------------------------------------------------------------------------------------- + +//! @p text's width at @p size (one line). +inline double +text_width(cairo_t *c, const std::string &text, double size, bool bold) +{ + PangoLayout *layout = pango_cairo_create_layout(c); + PangoFontDescription *font = pango_font_description_from_string(pico4_text::kFamilies); + pango_font_description_set_absolute_size(font, size * PANGO_SCALE); + pango_font_description_set_weight(font, bold ? PANGO_WEIGHT_SEMIBOLD : PANGO_WEIGHT_NORMAL); + pango_layout_set_font_description(layout, font); + pango_layout_set_text(layout, text.c_str(), -1); + int w, h; + pango_layout_get_pixel_size(layout, &w, &h); + pango_font_description_free(font); + g_object_unref(layout); + return w; +} + +//! One line of @p text vertically centred on @p mid, cut to @p width. +inline void +line_mid(cairo_t *c, const std::string &text, double x, double mid, double width, double size, bool bold, Rgb colour) +{ + set(c, colour); + pico4_text::line(c, text, x, mid - size * 0.62, width, size, bold); +} + +// -- The page's frame ------------------------------------------------------------------------------ + +struct Frame +{ + double w, h; + struct pico4_hits *hits; + int hover = PICO4_HIT_NONE; //!< the control under the laser + int pressed = PICO4_HIT_NONE; //!< the control held down + double now = 0; //!< for what moves (spinners, the caret) +}; + +//! The panel's background. +inline void +background(cairo_t *c, const Frame &f) +{ + set(c, kBg); + cairo_rectangle(c, 0, 0, f.w, f.h); + cairo_fill(c); +} + +/*! + * The top bar: with @p back_id a way back (an arrow), @p crumb before the @p title ("Overpressure + * Settings › Updates"), @p hint on the right with its icon, and the setup's progress (0 to 1, -1 + * none) as a line under it. + */ +inline void +topbar(cairo_t *c, const Frame &f, const std::string &title, const std::string &crumb, int back_id, Icon hint_icon, + const std::string &hint, double progress = -1) +{ + set(c, kLine); + cairo_rectangle(c, 0, kTopbarH - 1, f.w, 1); + cairo_fill(c); + if (progress >= 0) { + set(c, kPrimary); + cairo_rectangle(c, 0, kTopbarH - 3, f.w * std::min(1.0, progress), 3); + cairo_fill(c); + } + double x = 32; + const double mid = kTopbarH / 2; + if (back_id != PICO4_HIT_NONE) { + const double s = 56, bx = 20, by = mid - s / 2; + if (f.hover == back_id || f.pressed == back_id) { + fill_box(c, bx, by, s, s, 12, kHover); + } + icon(c, kLeft, bx + 14, by + 14, 28, f.hover == back_id ? kText : kMuted); + pico4_hits_add(f.hits, back_id, bx - 8, 0, s + 16, kTopbarH); + x = bx + s + 12; + } + double hint_w = 0; + if (!hint.empty()) { + hint_w = text_width(c, hint, kSmall, false); + const double hx = f.w - 32 - hint_w; + line_mid(c, hint, hx, mid, hint_w + 2, kSmall, false, kMuted); + if (hint_icon != kIcons) { + icon(c, hint_icon, hx - 36, mid - 13, 26, kMuted); + hint_w += 36; + } + hint_w += 24; + } + const double room = f.w - 32 - hint_w - x; + if (!crumb.empty()) { + const double cw = std::min(text_width(c, crumb, kTopText, false), room * 0.6); + line_mid(c, crumb, x, mid, cw + 2, kTopText, false, kMuted); + x += cw + 14; + line_mid(c, "\xE2\x80\xBA", x, mid, 20, kTopText, false, kMuted); // › + x += 26; + } + line_mid(c, title, x, mid, f.w - 32 - hint_w - x, kTopText, true, kText); +} + +//! The footer's line over its row of buttons. +inline void +footer(cairo_t *c, const Frame &f) +{ + set(c, kLine); + cairo_rectangle(c, 0, f.h - kFooterH, f.w, 1); + cairo_fill(c); +} + +//! The footer's buttons' top. +inline double +footer_y(const Frame &f) +{ + return f.h - kFooterH + (kFooterH - kButtonH) / 2; +} + +// -- Controls ------------------------------------------------------------------------------------------- + +enum Kind +{ + kSecondary, + kPrimaryKind, + kGhost, + kUpdate, +}; + +/*! + * A button: @p label with an icon before it (@p lead) or after it (@p trail), kIcons for none; + * @p w 0: as wide as its content. Returns its width. A disabled one shows dimmed and is not a control. + */ +inline double +button(cairo_t *c, const Frame &f, int id, double x, double y, double w, const std::string &label, Kind kind, + Icon lead = kIcons, Icon trail = kIcons, bool enabled = true, double h = kButtonH) +{ + const double isz = 28, gap = 12; + const double tw = label.empty() ? 0 : text_width(c, label, kButtonText, true); + const double content = tw + (lead != kIcons ? isz + (tw > 0 ? gap : 0) : 0) + (trail != kIcons ? isz + gap : 0); + if (w <= 0) { + w = content + (label.empty() ? 0 : 64) + (label.empty() ? h - isz : 0); + } + const bool hover = enabled && (f.hover == id || f.pressed == id); + Rgb back = kButton, ink = kText; + switch (kind) { + case kPrimaryKind: + back = hover ? kPrimaryHover : kPrimary; + ink = kWhite; + break; + case kGhost: + back = kHover; + ink = hover ? kText : kMuted; + break; + case kUpdate: + back = kUpdateBg; + ink = kUpdateText; + break; + default: back = hover ? kButtonHover : kButton; break; + } + const double alpha = enabled ? 1 : 0.45; + if (kind != kGhost || hover) { + fill_box(c, x, y, w, h, kButtonR, back, alpha); + } + if (kind == kSecondary || kind == kUpdate) { + pico4_overlay::rounded(c, x + 0.5, y + 0.5, w - 1, h - 1, kButtonR); + set(c, kind == kUpdate ? kUpdateLine : kLine, alpha); + cairo_set_line_width(c, 1); + cairo_stroke(c); + } + if (hover && kind != kGhost) { + hover_ring(c, x, y, w, h, kButtonR); + } + double cx = x + (w - content) / 2; + const Rgb dim = {ink.r * alpha + kBg.r * (1 - alpha), ink.g * alpha + kBg.g * (1 - alpha), ink.b * alpha + kBg.b * (1 - alpha)}; + if (lead != kIcons) { + icon(c, lead, cx, y + (h - isz) / 2, isz, dim); + cx += isz + (tw > 0 ? gap : 0); + } + if (tw > 0) { + line_mid(c, label, cx, y + h / 2, tw + 4, kButtonText, true, dim); + cx += tw + gap; + } + if (trail != kIcons) { + icon(c, trail, cx, y + (h - isz) / 2, isz, dim); + } + if (enabled) { + pico4_hits_add(f.hits, id, x, y, w, h); + } + return w; +} + +//! A grouped card's box. +inline void +group(cairo_t *c, double x, double y, double w, double h) +{ + fill_box(c, x, y, w, h, kGroupR, kPanel); +} + +//! A group's label (uppercase, as the client's), at (@p x, @p y); returns its height with the gap under it. +inline double +group_label(cairo_t *c, const std::string &text, double x, double y, double w) +{ + std::string upper; + gchar *u = g_utf8_strup(text.c_str(), -1); + upper = u; + g_free(u); + set(c, kMuted); + PangoLayout *layout = pango_cairo_create_layout(c); + PangoFontDescription *font = pango_font_description_from_string(pico4_text::kFamilies); + pango_font_description_set_absolute_size(font, kLabel * PANGO_SCALE); + pango_font_description_set_weight(font, PANGO_WEIGHT_SEMIBOLD); + pango_layout_set_font_description(layout, font); + pango_layout_set_width(layout, (int)(w * PANGO_SCALE)); + pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_END); + PangoAttrList *attrs = pango_attr_list_new(); + pango_attr_list_insert(attrs, pango_attr_letter_spacing_new((int)(kLabel * 0.06 * PANGO_SCALE))); + pango_layout_set_attributes(layout, attrs); + pango_layout_set_text(layout, upper.c_str(), -1); + cairo_move_to(c, x, y); + pango_cairo_show_layout(c, layout); + pango_attr_list_unref(attrs); + pango_font_description_free(font); + g_object_unref(layout); + return kLabel * 1.4 + 8; +} + +//! The line between two rows of a group. +inline void +row_line(cairo_t *c, double x, double y, double w) +{ + set(c, kLine); + cairo_rectangle(c, x, y, w, 1); + cairo_fill(c); +} + +enum Tone +{ + kNeutral, + kGood, + kInfoTone, + kWarn, +}; + +//! A pill with @p text (with a dot before it for kGood), its left at @p x, centred on @p mid; returns its width. +inline double +pill(cairo_t *c, const std::string &text, double x, double mid, Tone tone, bool right_aligned = false) +{ + const double size = 20, pad = 14, dot = tone == kGood ? 18 : 0; + const double w = text_width(c, text, size, true) + 2 * pad + dot, h = 36; + if (right_aligned) { + x -= w; + } + const Rgb back = tone == kGood ? kGoodBg : tone == kInfoTone ? kBlueBg : tone == kWarn ? kUpdateBg : kPillBg; + const Rgb ink = tone == kGood ? kGoodText : tone == kInfoTone ? kBlueText : tone == kWarn ? kUpdateText : kPillText; + fill_box(c, x, mid - h / 2, w, h, h / 2, back); + if (dot > 0) { + cairo_arc(c, x + pad + 5, mid, 5, 0, 2 * M_PI); + set(c, ink); + cairo_fill(c); + } + line_mid(c, text, x + pad + dot, mid, w, size, true, ink); + return w; +} + +//! An icon chip: a square (or round) tile with @p i in it. +inline void +chip(cairo_t *c, Icon i, double x, double y, double size, Rgb back, Rgb ink, bool round = false) +{ + if (round) { + cairo_arc(c, x + size / 2, y + size / 2, size / 2, 0, 2 * M_PI); + set(c, back); + cairo_fill(c); + } else { + fill_box(c, x, y, size, size, size / 4, back); + } + const double s = size * 0.46; + icon(c, i, x + (size - s) / 2, y + (size - s) / 2, s, ink); +} + +//! A spinner: an arc turning once in 0.9 s around (@p x, @p y). +inline void +spinner(cairo_t *c, double x, double y, double r, double now, Rgb ink = kBlue) +{ + cairo_new_path(c); + cairo_set_line_width(c, std::max(3.0, r / 4.5)); + cairo_set_line_cap(c, CAIRO_LINE_CAP_ROUND); + set(c, kTrack); + cairo_arc(c, x, y, r, 0, 2 * M_PI); + cairo_stroke(c); + const double a = std::fmod(now / 0.9, 1.0) * 2 * M_PI; + set(c, ink); + cairo_arc(c, x, y, r, a, a + 1.7); + cairo_stroke(c); +} + +/*! + * A progress bar @p w wide at (@p x, @p y): filled to @p fraction, or, with @p fraction below 0 + * (what cannot be measured), a segment moving along it. + */ +inline void +bar(cairo_t *c, double x, double y, double w, double fraction, double now, double h = 10) +{ + fill_box(c, x, y, w, h, h / 2, kTrack); + cairo_save(c); + pico4_overlay::rounded(c, x, y, w, h, h / 2); + cairo_clip(c); + set(c, kBlue); + if (fraction < 0) { + const double seg = w * 0.3, at = std::fmod(now / 1.4, 1.0) * (w + seg) - seg; + pico4_overlay::rounded(c, x + at, y, seg, h, h / 2); + cairo_fill(c); + } else if (fraction > 0) { + pico4_overlay::rounded(c, x, y, std::max(h, w * std::min(fraction, 1.0)), h, h / 2); + cairo_fill(c); + } + cairo_restore(c); +} + +//! A list's scroll track at the group's right edge: where the @p visible rows from @p first are, of @p count. +inline void +scroll_track(cairo_t *c, double x, double y, double h, int first, int visible, int count) +{ + if (count <= visible) { + return; + } + fill_box(c, x, y, 6, h, 3, kSurface); + const double thumb = std::max(40.0, h * visible / count), pos = (h - thumb) * first / (count - visible); + fill_box(c, x, y + pos, 6, thumb, 3, kScrollThumb); +} + +//! A box to tick, @p size px, at (@p x, @p y), in @p ink. +inline void +tick_box(cairo_t *c, double x, double y, double size, bool checked, Rgb ink) +{ + pico4_overlay::rounded(c, x + 1, y + 1, size - 2, size - 2, 8); + set(c, ink); + cairo_set_line_width(c, 2.5); + cairo_stroke(c); + if (checked) { + icon(c, kCheck, x + 4, y + 4, size - 8, ink); + } +} + +//! The headset's picture (the client's art), @p size px square with rounded corners; a chip where there is none. +inline void +headset_art(cairo_t *c, double x, double y, double size) +{ + static RsvgHandle *art = nullptr; + static bool tried = false; + if (!tried) { + tried = true; + const char *path = getenv("PICO4_HEADSET_ART"); + art = rsvg_handle_new_from_file(path != nullptr ? path : "/usr/share/pico4/headset.svg", nullptr); + } + cairo_save(c); + pico4_overlay::rounded(c, x, y, size, size, size * 0.23); + cairo_clip(c); + if (art != nullptr) { + RsvgRectangle box = {x, y, size, size}; + rsvg_handle_render_document(art, c, &box, nullptr); + } else { + set(c, kSurface); + cairo_paint(c); + icon(c, kLenses, x + size * 0.27, y + size * 0.27, size * 0.46, kBlue); + } + cairo_restore(c); +} + +} // namespace pico4_ui diff --git a/phoenix/pico4-monado/pico4_ui_hits.h b/phoenix/pico4-monado/pico4_ui_hits.h new file mode 100644 index 0000000..e9b6b43 --- /dev/null +++ b/phoenix/pico4-monado/pico4_ui_hits.h @@ -0,0 +1,101 @@ +// Copyright 2026, overpressure contributors. +// SPDX-License-Identifier: BSL-1.0 +/* + * Where a panel's controls are, as its last drawing put them (pico4_ui.hpp): each control registers + * its box with an id while the page draws, so the laser's press, release and hover find exactly + * what is on the panel, and a list that scrolls takes its rows along. Apart from drawing, for the + * tests. + */ +#pragma once + +#include + +#define PICO4_HITS_MAX 96 +#define PICO4_HIT_NONE (-1) + +struct pico4_hit +{ + double x, y, w, h; + int id; +}; + +struct pico4_hits +{ + struct pico4_hit box[PICO4_HITS_MAX]; + int count; + //! The area a list's rows are cut to: a row outside it is not on the panel. + double clip_y0, clip_y1; +}; + +static inline void +pico4_hits_clear(struct pico4_hits *h) +{ + h->count = 0; + h->clip_y0 = -1e9; + h->clip_y1 = 1e9; +} + +//! Rows registered from now on count only between @p y0 and @p y1 (a list's window); -1e9, 1e9 again after it. +static inline void +pico4_hits_clip(struct pico4_hits *h, double y0, double y1) +{ + h->clip_y0 = y0; + h->clip_y1 = y1; +} + +//! Register the box (@p x, @p y, @p w, @p h) as control @p id, cut to the current clip; false when the panel is full. +static inline bool +pico4_hits_add(struct pico4_hits *h, int id, double x, double y, double w, double h_) +{ + double top = y > h->clip_y0 ? y : h->clip_y0, bottom = y + h_ < h->clip_y1 ? y + h_ : h->clip_y1; + if (bottom <= top || w <= 0 || h->count >= PICO4_HITS_MAX) { + return false; + } + struct pico4_hit *b = &h->box[h->count++]; + b->x = x; + b->y = top; + b->w = w; + b->h = bottom - top; + b->id = id; + return true; +} + +//! The control at (@p x, @p y): the last registered on top, as drawn; PICO4_HIT_NONE where there is none. +static inline int +pico4_hits_at(const struct pico4_hits *h, double x, double y) +{ + for (int i = h->count - 1; i >= 0; i--) { + const struct pico4_hit *b = &h->box[i]; + if (x >= b->x && x < b->x + b->w && y >= b->y && y < b->y + b->h) { + return b->id; + } + } + return PICO4_HIT_NONE; +} + +/*! + * A list's first row after scrolling by @p delta rows (the thumbstick's step), from @p first, with + * @p visible rows shown of @p count: it never runs past either end. + */ +static inline int +pico4_list_scroll(int first, int delta, int visible, int count) +{ + int last = count - visible; + int to = first + delta; + if (to > last) { + to = last; + } + return to < 0 ? 0 : to; +} + +//! The first row that shows @p row, from @p first, with @p visible rows shown of @p count: the chosen row in view. +static inline int +pico4_list_reveal(int first, int row, int visible, int count) +{ + if (row < first) { + first = row; + } else if (row >= first + visible) { + first = row - visible + 1; + } + return pico4_list_scroll(first, 0, visible, count); +} diff --git a/phoenix/pico4-monado/test_pico4_lens_panel.c b/phoenix/pico4-monado/test_pico4_lens_panel.c index 626d6ee..1854133 100644 --- a/phoenix/pico4-monado/test_pico4_lens_panel.c +++ b/phoenix/pico4-monado/test_pico4_lens_panel.c @@ -1,7 +1,7 @@ // Copyright 2026, overpressure contributors. // SPDX-License-Identifier: BSL-1.0 /* - * Overpressure Settings' lens distance page: its layout and presets. + * Overpressure Settings' lens distance: the range's gate, the slider's scale and the presets. * * cc -std=gnu11 -Isrc/xr src/xr/test_pico4_lens_panel.c -lm -o test_pico4_lens_panel */ @@ -24,27 +24,12 @@ static int failures; int main(void) { - // What a press hits. - EXPECT(pico4_panel_hit(50, 200, false) == PICO4_PANEL_MINUS); - EXPECT(pico4_panel_hit(750, 200, false) == PICO4_PANEL_PLUS); - EXPECT(pico4_panel_hit(400, 230, false) == PICO4_PANEL_SLIDER); - EXPECT(pico4_panel_hit(100, 350, false) == PICO4_PANEL_PRESET0); - EXPECT(pico4_panel_hit(300, 350, false) == PICO4_PANEL_PRESET0 + 1); - EXPECT(pico4_panel_hit(700, 350, false) == PICO4_PANEL_PRESET0 + 3); - EXPECT(pico4_panel_hit(205, 350, false) == PICO4_PANEL_NONE); // between two presets - EXPECT(pico4_panel_hit(780, 350, false) == PICO4_PANEL_NONE); - EXPECT(pico4_panel_hit(400, 100, false) == PICO4_PANEL_NONE); - // The warning takes the presets' row while it shows; the row above stays. - EXPECT(pico4_panel_hit(100, 350, true) == PICO4_PANEL_WARNING); - EXPECT(pico4_panel_hit(205, 350, true) == PICO4_PANEL_WARNING); - EXPECT(pico4_panel_hit(780, 350, true) == PICO4_PANEL_NONE); - EXPECT(pico4_panel_hit(50, 200, true) == PICO4_PANEL_MINUS); - // The slider's scale: PICO OS's 58 to 72 mm. - EXPECT(pico4_panel_slider_mm(PICO4_PANEL_SLIDER_X0) == 58.0); - EXPECT(pico4_panel_slider_mm(PICO4_PANEL_SLIDER_X1) == 72.0); - EXPECT(pico4_panel_slider_mm(0) == 58.0 && pico4_panel_slider_mm(800) == 72.0); - EXPECT(fabs(pico4_panel_slider_x(65.0) - (PICO4_PANEL_SLIDER_X0 + PICO4_PANEL_SLIDER_X1) / 2) < 1e-9); + EXPECT(pico4_panel_slider_mm(130, 130, 670) == 58.0); + EXPECT(pico4_panel_slider_mm(670, 130, 670) == 72.0); + EXPECT(pico4_panel_slider_mm(0, 130, 670) == 58.0 && pico4_panel_slider_mm(800, 130, 670) == 72.0); + EXPECT(fabs(pico4_panel_slider_x(65.0, 130, 670) - 400) < 1e-9); + EXPECT(pico4_panel_slider_mm(pico4_panel_slider_x(63.5, 200, 900), 200, 900) == 63.5); EXPECT(pico4_panel_clamp(50) == 58.0 && pico4_panel_clamp(80) == 72.0 && pico4_panel_clamp(63.5) == 63.5); // Closer than 62 mm only with the warning's box ticked; wider always goes. diff --git a/phoenix/pico4-monado/test_pico4_onboarding.c b/phoenix/pico4-monado/test_pico4_onboarding.c index dde8d07..47ab7d0 100644 --- a/phoenix/pico4-monado/test_pico4_onboarding.c +++ b/phoenix/pico4-monado/test_pico4_onboarding.c @@ -1,7 +1,7 @@ // Copyright 2026, overpressure contributors. // SPDX-License-Identifier: BSL-1.0 /* - * The setup panel's buttons and the controllers' pairing. + * The controllers' pairing, as the setup's first step and the settings' panel in front use it. * * cc -std=gnu11 -Isrc/xr src/xr/test_pico4_onboarding.c -o test_pico4_onboarding */ @@ -58,14 +58,6 @@ main(void) EXPECT(!left && right); EXPECT(!pico4_pairing_parse_status("error request", &left, &right)); - // The buttons: Pair only when shown. - EXPECT(pico4_tour_hit(100, 500, false) == PICO4_TOUR_SKIP); - EXPECT(pico4_tour_hit(450, 500, true) == PICO4_TOUR_PAIR); - EXPECT(pico4_tour_hit(450, 500, false) == PICO4_TOUR_NONE); - EXPECT(pico4_tour_hit(800, 520, false) == PICO4_TOUR_NEXT); - EXPECT(pico4_tour_hit(800, 300, false) == PICO4_TOUR_NONE); - EXPECT(pico4_tour_hit(320, 500, true) == PICO4_TOUR_NONE); // between Skip and Pair - if (failures != 0) { printf("%d failure(s)\n", failures); return 1; diff --git a/phoenix/pico4-monado/test_pico4_settings.c b/phoenix/pico4-monado/test_pico4_settings.c index 4e97c21..db1a21c 100644 --- a/phoenix/pico4-monado/test_pico4_settings.c +++ b/phoenix/pico4-monado/test_pico4_settings.c @@ -6,6 +6,7 @@ */ #include "pico4_pairing.h" #include "pico4_settings.h" +#include "pico4_ui_hits.h" #include @@ -22,29 +23,26 @@ static int failures; int main(void) { - // The menu: one entry per page, nothing between or below them, nothing on the page side. - EXPECT(pico4_settings_menu_hit(100, 120) == PICO4_SETTINGS_LENSES); - EXPECT(pico4_settings_menu_hit(100, 200) == PICO4_SETTINGS_CONTROLLERS); - EXPECT(pico4_settings_menu_hit(100, 280) == PICO4_SETTINGS_UPDATES); - EXPECT(pico4_settings_menu_hit(100, 180) == PICO4_SETTINGS_NONE); - EXPECT(pico4_settings_menu_hit(100, 256) == PICO4_SETTINGS_NONE); - EXPECT(pico4_settings_menu_hit(100, 360) == PICO4_SETTINGS_NONE); - EXPECT(PICO4_SETTINGS_ENTRY_Y + PICO4_SETTINGS_PAGES * PICO4_SETTINGS_ENTRY_STEP <= PICO4_SETTINGS_H); - EXPECT(pico4_settings_menu_hit(100, 60) == PICO4_SETTINGS_NONE); - EXPECT(pico4_settings_menu_hit(400, 120) == PICO4_SETTINGS_NONE); - // Both pages fit beside the menu. - EXPECT(PICO4_SETTINGS_PAGE_X + PICO4_PANEL_W <= PICO4_SETTINGS_W); - EXPECT(PICO4_SETTINGS_PAGE_Y + PICO4_PANEL_H <= PICO4_SETTINGS_H); - EXPECT(PICO4_CONTROLLERS_PAIR_X + PICO4_CONTROLLERS_PAIR_W <= PICO4_CONTROLLERS_W); + // The tab's home and its four pages. + EXPECT(PICO4_SETTINGS_HOME == 0 && PICO4_SETTINGS_PAGES == 5); - // A hand's Pair button only where it is shown; Close only on the panel in front. - EXPECT(pico4_controllers_hit(600, 40, true, true, false) == PICO4_CONTROLLERS_PAIR_LEFT); - EXPECT(pico4_controllers_hit(600, 140, true, true, false) == PICO4_CONTROLLERS_PAIR_RIGHT); - EXPECT(pico4_controllers_hit(600, 40, false, true, false) == PICO4_CONTROLLERS_NONE); - EXPECT(pico4_controllers_hit(600, 92, true, true, false) == PICO4_CONTROLLERS_NONE); // between the rows - EXPECT(pico4_controllers_hit(300, 40, true, true, false) == PICO4_CONTROLLERS_NONE); - EXPECT(pico4_controllers_hit(600, 440, false, false, true) == PICO4_CONTROLLERS_CLOSE); - EXPECT(pico4_controllers_hit(600, 440, false, false, false) == PICO4_CONTROLLERS_NONE); + // The About page's versions: the image's version file, and a package's from pacman's database. + char v[64]; + const char *file = "version=2026.12.0b1\ncommit=2026.12.0b0-13-g8b9e107\nkernel=phoenix/7.2-11\npackages=2026.12.1\n"; + EXPECT(pico4_about_value(file, "kernel", v, sizeof(v)) && strcmp(v, "phoenix/7.2-11") == 0); + EXPECT(pico4_about_value(file, "packages", v, sizeof(v)) && strcmp(v, "2026.12.1") == 0); + EXPECT(pico4_about_value(file, "version", v, sizeof(v)) && strcmp(v, "2026.12.0b1") == 0); + EXPECT(!pico4_about_value(file, "flavour", v, sizeof(v))); + EXPECT(!pico4_about_value(file, "kern", v, sizeof(v))); // a key is the whole name before = + EXPECT(pico4_about_package("pico4-monado-25.1.0-23", "pico4-monado", v, sizeof(v)) && strcmp(v, "25.1.0-23") == 0); + EXPECT(pico4_about_package("deckard-mesa-linux-aarch64-1:26.1.6-1", "deckard-mesa-linux-aarch64", v, sizeof(v)) && + strcmp(v, "1:26.1.6-1") == 0); + EXPECT(!pico4_about_package("pico4-monado-debug-25.1.0-23", "pico4-monado", v, sizeof(v))); + EXPECT(!pico4_about_package("steamvr-2.9.4-1", "pico4-monado", v, sizeof(v))); + // SteamVR's: a version that starts with a letter (Valve's revision). + EXPECT(pico4_about_package("deckard-steamvr-rel-r25358740+fefbdc82-1", "deckard-steamvr-rel", v, sizeof(v)) && + strcmp(v, "r25358740+fefbdc82-1") == 0); + EXPECT(!pico4_about_package("deckard-steamvr-session-1.6.1-8", "deckard-steamvr", v, sizeof(v))); // In front of the wearer: no controller, no pairing, the setup over, after the wait. EXPECT(pico4_settings_rescue(false, true, false, false, 0, 25, PICO4_PAIRING_WAIT_S)); @@ -114,12 +112,21 @@ main(void) char cut[8]; EXPECT(!pico4_json_field("{\"title\": \"no end", "title", cut, sizeof(cut))); EXPECT(pico4_json_field("{\"title\": \"a long title\"}", "title", cut, sizeof(cut)) && strcmp(cut, "a long ") == 0); - // The button fits on the page, and only where it is shown. - EXPECT(PICO4_UPDATES_BUTTON_Y + PICO4_UPDATES_BUTTON_H <= PICO4_PANEL_H); - EXPECT(PICO4_UPDATES_BUTTON_X >= 0); - EXPECT(pico4_updates_hit(PICO4_UPDATES_BUTTON_X + 10, PICO4_UPDATES_BUTTON_Y + 10, true)); - EXPECT(!pico4_updates_hit(PICO4_UPDATES_BUTTON_X + 10, PICO4_UPDATES_BUTTON_Y + 10, false)); - EXPECT(!pico4_updates_hit(PICO4_UPDATES_BUTTON_X - 10, PICO4_UPDATES_BUTTON_Y + 10, true)); + + // The panels' controls: where the last drawing put them, the top one first, a list's rows cut to its window. + struct pico4_hits h; + pico4_hits_clear(&h); + EXPECT(pico4_hits_add(&h, 1, 100, 100, 200, 72)); + EXPECT(pico4_hits_add(&h, 2, 150, 120, 50, 20)); // drawn over the first + EXPECT(pico4_hits_at(&h, 160, 125) == 2 && pico4_hits_at(&h, 110, 110) == 1 && pico4_hits_at(&h, 90, 110) == PICO4_HIT_NONE); + pico4_hits_clip(&h, 200, 400); + EXPECT(!pico4_hits_add(&h, 3, 0, 100, 500, 80)); // scrolled above the window + EXPECT(pico4_hits_add(&h, 4, 0, 360, 500, 80)); // half in it: only that half is a row + EXPECT(pico4_hits_at(&h, 10, 390) == 4 && pico4_hits_at(&h, 10, 410) == PICO4_HIT_NONE); + // The thumbstick scrolls a list by rows, never past its ends; a chosen row comes into view. + EXPECT(pico4_list_scroll(0, 1, 4, 31) == 1 && pico4_list_scroll(0, -1, 4, 31) == 0 && pico4_list_scroll(27, 1, 4, 31) == 27); + EXPECT(pico4_list_scroll(0, 1, 4, 3) == 0); // fewer rows than the window + EXPECT(pico4_list_reveal(0, 10, 4, 31) == 7 && pico4_list_reveal(8, 3, 4, 31) == 3 && pico4_list_reveal(2, 4, 4, 31) == 2); if (failures != 0) { printf("%d failure(s)\n", failures); diff --git a/phoenix/pico4-monado/test_pico4_setup.c b/phoenix/pico4-monado/test_pico4_setup.c index 03a404b..0cca566 100644 --- a/phoenix/pico4-monado/test_pico4_setup.c +++ b/phoenix/pico4-monado/test_pico4_setup.c @@ -21,10 +21,16 @@ static int failures; static void test_pages(void) { - EXPECT(pico4_setup_next(PICO4_SETUP_WELCOME) == PICO4_SETUP_LANGUAGE); + // First what needs no laser and no sharp sight: the controllers, the lenses; then the rest. + EXPECT(pico4_setup_next(PICO4_SETUP_CONTROLLERS) == PICO4_SETUP_IPD); + EXPECT(pico4_setup_next(PICO4_SETUP_IPD) == PICO4_SETUP_LANGUAGE); + EXPECT(pico4_setup_next(PICO4_SETUP_WIFI) == PICO4_SETUP_READY); EXPECT(pico4_setup_next(PICO4_SETUP_READY) == PICO4_SETUP_PAGES); - EXPECT(pico4_setup_back(PICO4_SETUP_LANGUAGE) == PICO4_SETUP_WELCOME); - EXPECT(pico4_setup_back(PICO4_SETUP_WELCOME) == PICO4_SETUP_WELCOME); + EXPECT(pico4_setup_back(PICO4_SETUP_LANGUAGE) == PICO4_SETUP_IPD); + EXPECT(pico4_setup_back(PICO4_SETUP_CONTROLLERS) == PICO4_SETUP_CONTROLLERS); + EXPECT(pico4_setup_first(false, false) == PICO4_SETUP_CONTROLLERS); + EXPECT(pico4_setup_first(true, false) == PICO4_SETUP_CONTROLLERS); + EXPECT(pico4_setup_first(true, true) == PICO4_SETUP_IPD); // Before the first sign-in, until finished once; never on a headset someone signed in on. EXPECT(pico4_setup_starts(false, false)); EXPECT(!pico4_setup_starts(false, true)); @@ -58,27 +64,6 @@ test_tables(void) EXPECT(strcmp(text, "UTC+05:45") == 0); } -static void -test_lists(void) -{ - EXPECT(pico4_setup_list_pages(0) == 1); - EXPECT(pico4_setup_list_pages(PICO4_SETUP_ROWS) == 1); - EXPECT(pico4_setup_list_pages(PICO4_SETUP_ROWS + 1) == 2); - EXPECT(pico4_setup_list_page(PICO4_SETUP_ROWS) == 1); - EXPECT(pico4_setup_list_turn(0, -1, 31) == 0); - EXPECT(pico4_setup_list_turn(4, 1, 31) == 5); - EXPECT(pico4_setup_list_turn(6, 1, 31) == 6); // the last of 7 - // Rows above the page's note (y 440) and the buttons, arrows beside them. - EXPECT(PICO4_SETUP_LIST_Y + PICO4_SETUP_ROWS * PICO4_SETUP_ROW_H <= 440.0); - EXPECT(pico4_setup_hit_row(100, PICO4_SETUP_LIST_Y + 1) == 0); - EXPECT(pico4_setup_hit_row(100, PICO4_SETUP_LIST_Y + PICO4_SETUP_ROW_H * (PICO4_SETUP_ROWS - 1) + 1) == PICO4_SETUP_ROWS - 1); - EXPECT(pico4_setup_hit_row(100, PICO4_SETUP_LIST_Y + PICO4_SETUP_ROW_H * PICO4_SETUP_ROWS + 1) == -1); - EXPECT(pico4_setup_hit_row(900, PICO4_SETUP_LIST_Y + 1) == -1); - EXPECT(pico4_setup_hit_arrow(900, PICO4_SETUP_LIST_Y + 10) == -1); - EXPECT(pico4_setup_hit_arrow(900, PICO4_SETUP_LIST_Y + PICO4_SETUP_ROWS * PICO4_SETUP_ROW_H - 10) == 1); - EXPECT(pico4_setup_hit_arrow(100, PICO4_SETUP_LIST_Y + 10) == 0); -} - static void test_ipd(void) { @@ -95,15 +80,9 @@ test_ipd(void) EXPECT(pico4_setup_ipd_gate(6050, 6000, false, &refused) == 6050 && refused); EXPECT(pico4_setup_ipd_gate(6050, 6100, false, &refused) == 6100 && !refused); EXPECT(pico4_setup_ipd_gate(6200, 6150, true, &refused) == 6150 && !refused); - EXPECT(pico4_setup_hit_warning(PICO4_SETUP_WARNING_X + 1, PICO4_SETUP_WARNING_Y + 1)); - EXPECT(!pico4_setup_hit_warning(PICO4_SETUP_WARNING_X - 1, PICO4_SETUP_WARNING_Y + 1)); - EXPECT(!pico4_setup_hit_warning(500, PICO4_SETUP_IPD_Y + 1)); EXPECT(pico4_setup_parse_ipd("63.48\n") == 6348); EXPECT(pico4_setup_parse_ipd("error") == -1); EXPECT(pico4_setup_parse_ipd("9.0") == -1); - EXPECT(pico4_setup_hit_ipd(PICO4_SETUP_IPD_LESS_X + 1, PICO4_SETUP_IPD_Y + 1) == -1); - EXPECT(pico4_setup_hit_ipd(PICO4_SETUP_IPD_MORE_X + 1, PICO4_SETUP_IPD_Y + 1) == 1); - EXPECT(pico4_setup_hit_ipd(500, PICO4_SETUP_IPD_Y + 1) == 0); } static void @@ -171,11 +150,6 @@ test_joining(void) EXPECT(strcmp(text, "xxxxxxx") == 0); EXPECT(!pico4_setup_text_input(text, sizeof(text), "\xE2\x82\xAC") && strcmp(text, "xxxxxxx") == 0); - // The field and the show-password switch under it. - EXPECT(pico4_setup_hit_field(PICO4_SETUP_FIELD_X + 10, PICO4_SETUP_FIELD_Y + 10) == 1); - EXPECT(pico4_setup_hit_field(PICO4_SETUP_FIELD_X + 10, PICO4_SETUP_SHOW_Y + 10) == 2); - EXPECT(pico4_setup_hit_field(PICO4_SETUP_FIELD_X - 1, PICO4_SETUP_FIELD_Y + 10) == 0); - EXPECT(pico4_setup_hit_field(PICO4_SETUP_FIELD_X + PICO4_SETUP_SHOW_W + 1, PICO4_SETUP_SHOW_Y + 10) == 0); } static void @@ -243,7 +217,6 @@ main(void) { test_pages(); test_tables(); - test_lists(); test_ipd(); test_networks(); test_joining(); diff --git a/tests/test_onboarding_texts.py b/tests/test_onboarding_texts.py index 55a01dd..3752750 100644 --- a/tests/test_onboarding_texts.py +++ b/tests/test_onboarding_texts.py @@ -37,7 +37,7 @@ def setUp(self) -> None: def test_every_key_the_panel_uses_is_in_english_and_every_text_is_used(self) -> None: source = "".join( (RECIPE / name).read_text(encoding="utf-8") - for name in ("pico4-onboarding.cpp", "overpressure-settings.cpp") + for name in ("pico4-onboarding.cpp", "overpressure-settings.cpp", "pico4_pair_ui.hpp") ) english = self.languages["english"] self.assertFalse(set(re.findall(r'our\("([a-z_]+)"\)', source)) - set(english), "keys without English text") From b7dbc7ab0cebbe9cf7cbcbf71d54d61f36f463d9 Mon Sep 17 00:00:00 2001 From: Xenolphthalein <21215869+Xenolphthalein@users.noreply.github.com> Date: Wed, 2 Dec 2026 16:16:35 +0100 Subject: [PATCH 7/9] fix(pico4-monado): the panels see a controller that reconnects, the thumbstick scrolls, and they are larger with round corners The station tells a waiting pairing when the other hand connects, and the next listening waits for a fresh status. The panels take SteamVR's smooth scroll events, as gamescope does: the discrete ones never reached them. The setup, the Settings tab and the panel in front are a quarter larger at the same type size, with round corners; the pairing and the setup's lenses sit in the middle of the room. --- phoenix/pico4-monado/PKGBUILD | 26 +++---- .../pico4-monado/overpressure-settings.cpp | 65 +++++++++++----- phoenix/pico4-monado/pico4-onboarding.cpp | 75 ++++++++++++++----- phoenix/pico4-monado/pico4_onboarding.h | 6 +- phoenix/pico4-monado/pico4_pair_ui.hpp | 7 +- phoenix/pico4-monado/pico4_pairing.h | 13 ++++ phoenix/pico4-monado/pico4_settings.h | 12 +-- phoenix/pico4-monado/pico4_station.c | 20 ++++- phoenix/pico4-monado/pico4_station.h | 4 +- phoenix/pico4-monado/pico4_ui.hpp | 16 +++- phoenix/pico4-monado/pico4_ui_hits.h | 18 +++++ phoenix/pico4-monado/test_pico4_onboarding.c | 4 + phoenix/pico4-monado/test_pico4_settings.c | 6 ++ phoenix/pico4-monado/test_pico4_tracking.c | 19 +++++ 14 files changed, 223 insertions(+), 68 deletions(-) diff --git a/phoenix/pico4-monado/PKGBUILD b/phoenix/pico4-monado/PKGBUILD index 5d6be73..a3ed9a8 100644 --- a/phoenix/pico4-monado/PKGBUILD +++ b/phoenix/pico4-monado/PKGBUILD @@ -83,8 +83,8 @@ sha256sums=(SKIP '42d4a1ec923f5a32b93847370cf2c63e9b07a5d68d51c8a2e5214d995d51c1a0' '787136e02024254b355d1aae427799c206456307040ecc29d543962179364a96' '732a6738b8e89063d247c820f0fdf6de7be2b2b9435e751886450474ffa7a2d0' - '93a500075473c85d7c9d1ce81f609a26f876d18c8325b10af5e710c44657d7da' - '41bb03af46edb3c3a593cefbc2246382826a16a3b567619b937d9f45df85eedb' + 'c6f9b33382bc9abb75942be3588072cb8acc1944116e3f3406bd9dce8565ff48' + '1c7565884f9cacc4b208658d0fc11be770eb263837fea489db0c335d96227a9d' '46147c0c7d2013e76e4168479651813f462a9ee89e0ba3606427576b24099443' '723538607265c89266e50d5a301aabfcdf80b695088f0b73256364638bb83330' 'c9aed4ebbe10c87232c89dbd3299072bf311e50ebdc33d0c474ae302106e1900' @@ -93,18 +93,18 @@ sha256sums=(SKIP 'e160944ec154fa5caf43d2177396656c8561d1739df07510ce75c3b8ddafa3b3' '07e474ecbbb1e3a629735c123fe83cb1c9ca7c4dedf34392e1f99e06bdbf37c2' 'de4add87e8b087f7e1edfaa0212b052b435e94fde9cce0a28e8e410bcfeb6264' - '80c9b0202f41b2435f074e9148344b1556d5044c34a85d2f352fa03309d89569' - '809a439466334ceebfb1064f21dd95ee97c5551a1e49bd7323ad8c7e35c9a9ef' - '252c66a2909b3dfc656d938fa1dd863849e535f577f4b85b74e9c1b639477b87' + 'bb6561e792bdbcb7ec78eeb8b0a275fc138d930a3cde818ad34f2e56536a893d' + '03974180cb098b1b5c5d6fc48324a6e44c1fac26ad21e99cde7ec218e68f341f' + '0fe74dbd8f72c6e0763952a3e602771aa4d3c4b9c84871909fb4355d9b3b3756' '5cbe37ce8152ace06a53c6f0bec5b9fb6b639d9d2b86c6eb47864594112f87ab' '6b0d8e8479f4282bcaaaa46d0090417fa5e1ca72a03600a9b2da95cdf71f28d5' - '7aafc2f95d382c3445c98e546f32a52464183b2b9d0e05c77398c7d011aed823' - '40d1f6de82e150d62fd55c2c7abfea96844fc1aaa799902add20b0535c835f2c' - 'de7a05f2d66dbc091d610630e8753df12060e5349beb226a3f0a44ccb1033f78' - 'b60397ec12e3d18268b642ca8683ed67d5fee7cdb744169200689486c4d19c07' - 'c3bbe7d7186939e5cc3c912bd61c81ff920e733420447114b95ac1ca0d7dd772' - '2ccb5667159360c274f83b970b7bb3da8cdb383ee05c0e5672aaaccd00e010dd' - '420836e50fa840dceeb9f0a630d64cc18701a40376c26d7826320f8b90a9018c' + '8564f2babbd92aa89f26d448c6c6a9d2e9c7c07ac52c1fc9424f09fe11b226ed' + '82cb589128b7047e28c19267ab579abe4033e8003b0560841bbf7ea90bd79c8c' + '68f3ed1ca637c979193aa095819b5b27ebf80087f262488b1d752daf10248975' + '57b052998c5df61a691e163e4e43191e4f4994e610ea95a01ceb6a774b850be3' + 'f7419b19ba4a01f570420760a91c74183acc252eded0585dc212c542ba136e0d' + '80948b181cd55b1194842f7c4b284299ed4cf91c5ee9978fa31d1938e5c97501' + '94c45d48bfe6d226b56d10088ae7fc31839f50612db412800c9fb5e566a5797a' '4b58a623d5ebe53c2a30ed6710f25c66da8c96b2c014525fd08b479a8abbcd83' 'ccb6d333b26d172ac07fc2de3234883afccb2ae5ce0419cf3b067fe971d12372' '4104d15d75e3dff32b8edf5779b9a73cacd85e5a36d6bd1a8c23f928889a3cc6' @@ -120,7 +120,7 @@ sha256sums=(SKIP 'a52d561a66f774bfab2183f626d1eca003e69e40d5b1ef98a5e8fc2b1e4c4377' '3b5723d2dfee9343828f49228ccaaf490205e2588bb02b39d5171b5d7299b619' '85c59e96fa7aff425f05c3129679c707a324de9ff7870d11b977e2439c2c6463' - '7e332686ec26c09e0a0162047f3ec99e09cfa8bd1428f7acc8699b5646c46b67' + '3dd972b7ab16bec8b7580d1894abea7168f3777c0d4d2a489bf0dac27955c2db' '4d65eeb635e98fb994fecf8cd5448e754c97c598eacea86852fb8930eaaadd08' '6f9e6b63f008118305f60253257bcbf28354594e84b7bd8fa3b5ca33dcd11872' '6168eaa35df0d363fbd7b5b86fca92b2aa63c2c06979932cf03a9531279773cc' diff --git a/phoenix/pico4-monado/overpressure-settings.cpp b/phoenix/pico4-monado/overpressure-settings.cpp index 523bbba..9e0d2ce 100644 --- a/phoenix/pico4-monado/overpressure-settings.cpp +++ b/phoenix/pico4-monado/overpressure-settings.cpp @@ -214,7 +214,7 @@ constexpr long long kStepHold = 10; //! Seconds between frames of what moves. constexpr double kAnimation = 1.0 / 15; //! The About list's rows shown at once. -constexpr int kAboutRows = 4; +constexpr int kAboutRows = 6; std::string presets_path() @@ -536,10 +536,11 @@ draw_lenses(cairo_t *c, const Frame &f, State &s, const Texts &t) } pico4_hits_add(f.hits, kLensSlider, l.slider_x0 - 20, ry, sw + 40, kButtonH); // The presets, for people taking turns. - const double py = gy + gh + 24, ph = f.h - 20 - py; + // Tiles of their own height: the page's room below stays free (a longer text has it). + const double tile_h = 132, py = gy + gh + 24, ph = 58 + tile_h + 22; group(c, kColX, py, kColW, ph); group_label(c, t.our("lens_people"), kColX + pad, py + 22, inner_w); - const double tgap = 16, tw = (kColW - 2 * 24 - 3 * tgap) / 4, tile_y = py + 58, tile_h = ph - 58 - 22; + const double tgap = 16, tw = (kColW - 2 * 24 - 3 * tgap) / 4, tile_y = py + 58, text_y = tile_y + 14; for (int i = 0; i < PICO4_PANEL_PRESETS; i++) { const double tx = kColX + 24 + i * (tw + tgap); const int id = kPreset0 + i; @@ -552,17 +553,17 @@ draw_lenses(cairo_t *c, const Frame &f, State &s, const Texts &t) char number[8]; snprintf(number, sizeof(number), "%d", i + 1); set(c, kMuted); - pico4_text::draw(c, fill(t.our("lens_preset"), number), tx + 8, tile_y + 10, tw - 16, 20, false, pico4_text::kCenter); + pico4_text::draw(c, fill(t.our("lens_preset"), number), tx + 8, text_y + 10, tw - 16, 20, false, pico4_text::kCenter); if (l.pressed_preset == i && l.stored) { set(c, kGoodText); - pico4_text::draw(c, t.our("lens_stored"), tx + 8, tile_y + 40, tw - 16, 26, true, pico4_text::kCenter); + pico4_text::draw(c, t.our("lens_stored"), tx + 8, text_y + 40, tw - 16, 26, true, pico4_text::kCenter); } else if (l.presets[i] > 0) { snprintf(number, sizeof(number), "%.1f", l.presets[i]); set(c, kText); - pico4_text::draw(c, number, tx + 8, tile_y + 38, tw - 16, 30, true, pico4_text::kCenter); + pico4_text::draw(c, number, tx + 8, text_y + 38, tw - 16, 30, true, pico4_text::kCenter); } else { set(c, kMuted); - pico4_text::draw(c, t.our("lens_hold"), tx + 8, tile_y + 44, tw - 16, 20, false, pico4_text::kCenter); + pico4_text::draw(c, t.our("lens_hold"), tx + 8, text_y + 44, tw - 16, 20, false, pico4_text::kCenter); } pico4_hits_add(f.hits, id, tx, tile_y, tw, tile_h); } @@ -1017,12 +1018,13 @@ main(int argc, char **argv) } const vr::HmdVector2_t tab_scale = {{(float)PICO4_SETTINGS_W, (float)PICO4_SETTINGS_H}}; const vr::HmdVector2_t front_scale = {{(float)PICO4_FRONT_W, (float)PICO4_FRONT_H}}; - overlay->SetOverlayWidthInMeters(tab, 2.2f); + overlay->SetOverlayWidthInMeters(tab, PICO4_SETTINGS_M); overlay->SetOverlayInputMethod(tab, vr::VROverlayInputMethod_Mouse); overlay->SetOverlayMouseScale(tab, &tab_scale); - // The thumbstick: up and down scroll a list, left and right move the lenses. - overlay->SetOverlayFlag(tab, vr::VROverlayFlags_SendVRDiscreteScrollEvents, true); - overlay->SetOverlayWidthInMeters(front, 0.96f); + // The thumbstick: up and down scroll a list, left and right move the lenses. Smooth scrolling, as + // gamescope's windows take it: SteamVR's discrete events never reached these panels. + overlay->SetOverlayFlag(tab, vr::VROverlayFlags_SendVRSmoothScrollEvents, true); + overlay->SetOverlayWidthInMeters(front, PICO4_FRONT_M); overlay->SetOverlayInputMethod(front, vr::VROverlayInputMethod_Mouse); overlay->SetOverlayMouseScale(front, &front_scale); // The laser reaches the panel outside the dashboard too, and it is drawn over Steam's window. @@ -1066,6 +1068,10 @@ main(int argc, char **argv) const double started = now_s(); double next_read = 0, next_status = 0, next_registry = 0, both_since = 0; bool tab_dirty = true, front_dirty = false, drawn = false, running = true; + bool status_fresh = false; //!< a status answered since the last pairing: the rescue waits for it + size_t pair_told = 0; //!< the pairing's answers taken so far + float scroll_x = 0, scroll_y = 0; //!< the thumbstick's scrolling, short of a step + bool scroll_seen = false; auto start_pairing = [&](int hand, bool hands_free) { char text[32]; @@ -1075,6 +1081,8 @@ main(int argc, char **argv) k.pairing = hand; k.pairing_at = now_s(); k.message = nullptr; + pair_told = 0; + status_fresh = false; } else { k.message = "controller_radio"; } @@ -1161,6 +1169,7 @@ main(int argc, char **argv) } case vr::VREvent_FocusLeave: s.hover = PICO4_HIT_NONE; + scroll_x = scroll_y = 0; tab_dirty = true; break; case vr::VREvent_MouseButtonDown: @@ -1195,13 +1204,22 @@ main(int argc, char **argv) tab_dirty = true; break; } - case vr::VREvent_ScrollDiscrete: { + case vr::VREvent_ScrollSmooth: { + // Up and down scroll the About list, left and right move the lenses (positive: up, left). const float dx = e.data.scroll.xdelta, dy = e.data.scroll.ydelta; - if (s.page == PICO4_SETTINGS_ABOUT && fabsf(dy) >= fabsf(dx) && dy != 0) { - s.about.first = pico4_list_scroll(s.about.first, dy > 0 ? -1 : 1, kAboutRows, 8); + if (!scroll_seen) { + scroll_seen = true; + printf("overpressure-settings: the thumbstick scrolls (%.2f, %.2f)\n", dx, dy); + fflush(stdout); + } + const bool across = fabsf(dx) > fabsf(dy); + const int down = across ? 0 : -pico4_scroll_steps(&scroll_y, dy); + const int wider = across ? -pico4_scroll_steps(&scroll_x, dx) : 0; + if (s.page == PICO4_SETTINGS_ABOUT && down != 0) { + s.about.first = pico4_list_scroll(s.about.first, down, kAboutRows, 8); tab_dirty = true; - } else if (s.page == PICO4_SETTINGS_LENSES && dx != 0 && shown_mm(l) > 0) { - request_move(l, shown_mm(l), shown_mm(l) + (dx > 0 ? 1 : -1) * PICO4_PANEL_STEP_MM); + } else if (s.page == PICO4_SETTINGS_LENSES && wider != 0 && shown_mm(l) > 0) { + request_move(l, shown_mm(l), shown_mm(l) + wider * PICO4_PANEL_STEP_MM); tab_dirty = true; } break; @@ -1305,10 +1323,21 @@ main(int argc, char **argv) k.known = true; k.left = left; k.right = right; + status_fresh = true; } status.answers.clear(); } - if (pair.poll() && pair.done) { + if (pair.poll()) { + // The other hand reconnecting by itself while this one is listened for. + for (; pair_told < pair.answers.size(); pair_told++) { + const int other = pico4_pairing_connected(pair.answers[pair_told].c_str()); + if (other != 0) { + (other == 1 ? k.left : k.right) = true; + tab_dirty = front_dirty = true; + } + } + } + if (pair.done && k.pairing != 0) { const int result = pair.answers.empty() ? -1 : pico4_pairing_answer(pair.answers.back().c_str()); if (result == 1) { // Connected now, before the next status: hands-free pairing must not take the other hand. @@ -1321,7 +1350,7 @@ main(int argc, char **argv) tab_dirty = front_dirty = true; } // Hands-free pairing: nothing can point at a panel while no controller is there. - if (pico4_settings_rescue(setup_pending, k.known, k.left, k.right, k.pairing, now - started, PICO4_PAIRING_WAIT_S)) { + if (status_fresh && pico4_settings_rescue(setup_pending, k.known, k.left, k.right, k.pairing, now - started, PICO4_PAIRING_WAIT_S)) { show_front(true); k.last_hands_free = pico4_pairing_hands_free(false, false, k.last_hands_free); start_pairing(k.last_hands_free, true); diff --git a/phoenix/pico4-monado/pico4-onboarding.cpp b/phoenix/pico4-monado/pico4-onboarding.cpp index 5df9a0d..068c133 100644 --- a/phoenix/pico4-monado/pico4-onboarding.cpp +++ b/phoenix/pico4-monado/pico4-onboarding.cpp @@ -224,7 +224,7 @@ enum Id constexpr double kSide = pico4_ui::kSide; //! A list's window: four rows between the top bar and the footer. -constexpr int kListRows = 4; +constexpr int kListRows = 6; constexpr double kListY = pico4_ui::kTopbarH + 24, kListH = kListRows * pico4_ui::kRowH; //! Seconds the pairing page shows both controllers before the lenses come. constexpr double kBothShown = 1.6; @@ -432,8 +432,10 @@ draw_ipd(cairo_t *c, const Frame &f, State &s, const Texts &t) { Setup &u = s.setup; page_top(c, f, t, u, t.our("setup_ipd_title")); - // A Siemens star: its black and white wedges blur together while the lenses are not set. - const double sx = kSide, sy = kTopbarH + 32, ss = 300, cx = sx + ss / 2, cy = sy + ss / 2; + // A Siemens star: its black and white wedges blur together while the lenses are not set. It and the + // column beside it stand in the middle of the room above the footer. + const double room = f.h - kFooterH - kTopbarH, ss = 380, column = 116 + 140 + 16 + kButtonH; + const double sx = kSide, sy = kTopbarH + (room - ss) / 2, cx = sx + ss / 2, cy = sy + ss / 2; cairo_save(c); pico4_overlay::rounded(c, sx, sy, ss, ss, 24); cairo_clip(c); @@ -458,10 +460,11 @@ draw_ipd(cairo_t *c, const Frame &f, State &s, const Texts &t) snprintf(mm, sizeof(mm), "\xE2\x80\xA6"); } set(c, shown >= 0 && shown < PICO4_SETUP_IPD_CLOSE ? kOrange : kText); - pico4_text::line(c, mm, x, sy - 6, 320, 96, true); + const double top = sy + (ss - column) / 2; + pico4_text::line(c, mm, x, top - 6, 320, 96, true); set(c, kMuted); - pico4_text::line(c, "mm", x + text_width(c, mm, 96, true) + 12, sy + 46, 80, 36, false); - const double slot_y = sy + 116, slot_h = 140; + pico4_text::line(c, "mm", x + text_width(c, mm, 96, true) + 12, top + 46, 80, 36, false); + const double slot_y = top + 116, slot_h = 140; if (u.ipd_warning) { const bool hover = f.hover == kLensWarning || f.pressed == kLensWarning; fill_box(c, x, slot_y, w, slot_h, 16, kWarnBg); @@ -470,9 +473,11 @@ draw_ipd(cairo_t *c, const Frame &f, State &s, const Texts &t) cairo_set_line_width(c, hover ? 2 : 1); cairo_stroke(c); set(c, kWarnText); - pico4_text::draw(c, t.our("lens_close_short"), x + 20, slot_y + 12, w - 40, kSmall, false); - tick_box(c, x + 20, slot_y + slot_h - 50, 34, u.ipd_confirmed, kWarnHeading); - line_mid(c, t.our("lens_closer"), x + 68, slot_y + slot_h - 33, w - 90, kSmall, true, kWarnHeading); + // The tick under the words, however many lines they take (the room fits two). + const double said = pico4_text::draw(c, t.our("lens_close_short"), x + 20, slot_y + 16, w - 40, kSmall, false); + const double tick_y = std::min(slot_y + 16 + said + 14, slot_y + slot_h - 48); + tick_box(c, x + 20, tick_y, 34, u.ipd_confirmed, kWarnHeading); + line_mid(c, t.our("lens_closer"), x + 68, tick_y + 17, w - 90, kSmall, true, kWarnHeading); pico4_hits_add(f.hits, kLensWarning, x, slot_y, w, slot_h); } else { set(c, kMuted); @@ -889,11 +894,12 @@ main(int argc, char **argv) vr::HmdVector2_t scale = {{(float)PICO4_TOUR_W, (float)PICO4_TOUR_H}}; overlay->SetOverlayInputMethod(front, vr::VROverlayInputMethod_Mouse); overlay->SetOverlayMouseScale(front, &scale); - overlay->SetOverlayWidthInMeters(front, 1.2f); + overlay->SetOverlayWidthInMeters(front, PICO4_TOUR_M); // The laser reaches the panel outside the dashboard too, and it is drawn over Steam's window. overlay->SetOverlayFlag(front, vr::VROverlayFlags_MakeOverlaysInteractiveIfVisible, true); - // The thumbstick: up and down scroll a list, left and right move the lenses. - overlay->SetOverlayFlag(front, vr::VROverlayFlags_SendVRDiscreteScrollEvents, true); + // The thumbstick: up and down scroll a list, left and right move the lenses. Smooth scrolling, as + // gamescope's windows take it: SteamVR's discrete events never reached these panels. + overlay->SetOverlayFlag(front, vr::VROverlayFlags_SendVRSmoothScrollEvents, true); overlay->SetOverlaySortOrder(front, 100); cairo_surface_t *surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, PICO4_TOUR_W, PICO4_TOUR_H); @@ -922,6 +928,12 @@ main(int argc, char **argv) bool view_pending = false; //!< the setup runs; its room view and closed dashboard still to come bool oobe = false; bool dirty = true, running = true; + //! A status answered since the last pairing: the next listening waits for it, or a controller that + //! reconnected by itself meanwhile would be listened for again, and the status never asked. + bool status_fresh = false; + size_t pair_told = 0; //!< the pairing's answers taken so far + float scroll_x = 0, scroll_y = 0; //!< the thumbstick's scrolling, short of a step + bool scroll_seen = false; // The client's texts follow its first start (it unpacks itself), and the language a page set. std::string texts_language = texts.language; bool texts_steam = texts.steam_found; @@ -959,6 +971,8 @@ main(int argc, char **argv) s.pairing = hand; s.pairing_at = now_s(); s.message.clear(); + pair_told = 0; + status_fresh = false; } else { s.message = texts.our("controller_radio"); next_pair_try = now_s() + 3; @@ -1271,6 +1285,7 @@ main(int argc, char **argv) } case vr::VREvent_FocusLeave: s.hover = PICO4_HIT_NONE; + scroll_x = scroll_y = 0; dirty = true; break; case vr::VREvent_MouseButtonDown: @@ -1292,13 +1307,21 @@ main(int argc, char **argv) dirty = true; break; } - case vr::VREvent_ScrollDiscrete: { + case vr::VREvent_ScrollSmooth: { + // Up and down scroll a list, left and right move the lenses (positive: up, left). const float dx = e.data.scroll.xdelta, dy = e.data.scroll.ydelta; - if (u.page == PICO4_SETUP_IPD && dx != 0) { - lens(dx > 0 ? 1 : -1); - } else if (dy != 0 && fabsf(dy) >= fabsf(dx) && list_count(u) > 0) { - u.first = pico4_list_scroll(u.first, dy > 0 ? -1 : 1, kListRows, list_count(u)); - s.hover = pico4_hits_at(&s.hits, x, y); + if (!scroll_seen) { + scroll_seen = true; + printf("pico4-onboarding: the thumbstick scrolls (%.2f, %.2f)\n", dx, dy); + fflush(stdout); + } + const bool across = fabsf(dx) > fabsf(dy); + const int down = across ? 0 : -pico4_scroll_steps(&scroll_y, dy); + const int wider = across ? -pico4_scroll_steps(&scroll_x, dx) : 0; + if (u.page == PICO4_SETUP_IPD && wider != 0) { + lens(wider); + } else if (down != 0 && list_count(u) > 0) { + u.first = pico4_list_scroll(u.first, down, kListRows, list_count(u)); dirty = true; } break; @@ -1408,10 +1431,21 @@ main(int argc, char **argv) s.known = true; s.left = left; s.right = right; + status_fresh = true; } status.answers.clear(); } - if (pair.poll() && pair.done) { + if (pair.poll()) { + // The other hand reconnecting by itself while this one is listened for. + for (; pair_told < pair.answers.size(); pair_told++) { + const int other = pico4_pairing_connected(pair.answers[pair_told].c_str()); + if (other != 0) { + (other == 1 ? s.left : s.right) = true; + dirty = true; + } + } + } + if (pair.done && s.pairing != 0) { const int result = pair.answers.empty() ? -1 : pico4_pairing_answer(pair.answers.back().c_str()); if (result == 1) { // Connected now, before the next status: the next listening takes the other hand. @@ -1423,7 +1457,8 @@ main(int argc, char **argv) } // The pairing page listens by itself, hand after hand, until both are there; elsewhere, with no // controller left (switched off meanwhile), nothing can point at the panel: back to it. - if (u.active && s.known && s.pairing == 0 && !pair.active() && !(s.left && s.right) && now >= next_pair_try) { + if (u.active && s.known && status_fresh && s.pairing == 0 && !pair.active() && !(s.left && s.right) && + now >= next_pair_try) { if (u.page == PICO4_SETUP_CONTROLLERS) { int hand = pico4_pairing_missing(s.left, s.right); if (hand == 0) { diff --git a/phoenix/pico4-monado/pico4_onboarding.h b/phoenix/pico4-monado/pico4_onboarding.h index dcc179f..345a31f 100644 --- a/phoenix/pico4-monado/pico4_onboarding.h +++ b/phoenix/pico4-monado/pico4_onboarding.h @@ -6,8 +6,10 @@ */ #pragma once -#define PICO4_TOUR_W 1000 -#define PICO4_TOUR_H 600 +// A quarter larger than the type needs, at a quarter more metres: room for longer languages. +#define PICO4_TOUR_W 1250 +#define PICO4_TOUR_H 750 +#define PICO4_TOUR_M 1.5f // The pages' texts, in every language, are in pico4-onboarding.strings; what to press to pair one // controller is PICO OS's instruction (its station service listens meanwhile). diff --git a/phoenix/pico4-monado/pico4_pair_ui.hpp b/phoenix/pico4-monado/pico4_pair_ui.hpp index 446abd2..65b146d 100644 --- a/phoenix/pico4-monado/pico4_pair_ui.hpp +++ b/phoenix/pico4-monado/pico4_pair_ui.hpp @@ -47,13 +47,16 @@ hand_pills(cairo_t *c, const Frame &f, const pico4_panels::Texts &t, const Pairi /*! * The page below the top bar: both connected (a tick), or the hand to pair with its two buttons - * and the listening's time. @p with_footer leaves the footer's room at the bottom. + * and the listening's time, in the middle of the room between the top bar and the bottom (or the + * footer, with @p with_footer). */ inline void content(cairo_t *c, const Frame &f, const pico4_panels::Texts &t, const Pairing &p, bool with_footer, bool next_lenses) { - const double w = f.w, top = kTopbarH + (with_footer ? 24 : 48); + const double w = f.w, bottom = with_footer ? f.h - kFooterH : f.h; + const double block = p.left && p.right ? (next_lenses ? 256 : 212) : 324; // what each draws below its top + const double top = std::max(kTopbarH + 24, kTopbarH + (bottom - kTopbarH - block) / 2); if (p.left && p.right) { const double s = 104; chip(c, kCheck, (w - s) / 2, top + 24, s, kGoodBg, kGoodText, true); diff --git a/phoenix/pico4-monado/pico4_pairing.h b/phoenix/pico4-monado/pico4_pairing.h index a9af0ae..2f570ba 100644 --- a/phoenix/pico4-monado/pico4_pairing.h +++ b/phoenix/pico4-monado/pico4_pairing.h @@ -69,6 +69,19 @@ pico4_pairing_answer(const char *answer) return strncmp(answer, "pairing ", 8) == 0 ? 0 : -1; } +/*! + * The other hand's controller connecting while a pairing listens ("connected right SERIAL"): 1 + * left, 2 right, 0 for any other answer. + */ +static inline int +pico4_pairing_connected(const char *answer) +{ + if (strncmp(answer, "connected left", 14) == 0 && (answer[14] == ' ' || answer[14] == '\0')) { + return 1; + } + return strncmp(answer, "connected right", 15) == 0 && (answer[15] == ' ' || answer[15] == '\0') ? 2 : 0; +} + /*! * The driver's status answer ("left connected SERIAL\nright disconnected"): each controller's * state; false for anything else. diff --git a/phoenix/pico4-monado/pico4_settings.h b/phoenix/pico4-monado/pico4_settings.h index b4cc9a1..2bb69cf 100644 --- a/phoenix/pico4-monado/pico4_settings.h +++ b/phoenix/pico4-monado/pico4_settings.h @@ -16,12 +16,14 @@ #include #include -// The whole tab, in its pixels, y down. -#define PICO4_SETTINGS_W 1100 -#define PICO4_SETTINGS_H 620 +// The whole tab, in its pixels, y down, and its width in metres (the pixels' size sets the type's). +#define PICO4_SETTINGS_W 1375 +#define PICO4_SETTINGS_H 775 +#define PICO4_SETTINGS_M 2.75f // The panel in front of the wearer for pairing. -#define PICO4_FRONT_W 800 -#define PICO4_FRONT_H 600 +#define PICO4_FRONT_W 1000 +#define PICO4_FRONT_H 750 +#define PICO4_FRONT_M 1.2f enum pico4_settings_page { diff --git a/phoenix/pico4-monado/pico4_station.c b/phoenix/pico4-monado/pico4_station.c index e00c1bd..47acb23 100644 --- a/phoenix/pico4-monado/pico4_station.c +++ b/phoenix/pico4-monado/pico4_station.c @@ -922,10 +922,10 @@ struct pico4_station_control struct pico4_station_ops ops; struct sockaddr_un addr; int64_t accepted_ms; - //! A pairing in progress: the hand, its connects when it started, when it ends. + //! A pairing in progress: the hand, its connects when it started (and the other hand's, as told), when it ends. bool pairing; enum pico4_station_hand hand; - uint32_t connects; + uint32_t connects, other_connects; int64_t deadline_ms; }; @@ -1021,7 +1021,16 @@ follow_pairing(struct pico4_station_control *c, int64_t now_ms, char *log, size_ } else if (gone) { snprintf(line, sizeof(line), "cancelled %s", hand_name(c->hand)); } else { - return 0; + // The other hand connected meanwhile: told, and the pairing goes on. + const enum pico4_station_hand other = c->hand == PICO4_STATION_HAND_LEFT ? PICO4_STATION_HAND_RIGHT : PICO4_STATION_HAND_LEFT; + struct pico4_station_controller o; + c->ops.get_controller(c->ops.ctx, other, &o); + if (!o.connected || o.connects == c->other_connects) { + return 0; + } + c->other_connects = o.connects; + snprintf(line, sizeof(line), "connected %s %s", hand_name(other), o.serial); + return answer(c, line, log, size); } // Also after a connect: the station must not stay open to other controllers. if (c->ops.pairing(c->ops.ctx, PICO4_STATION_PAIR_STOP, c->hand) != 0) { @@ -1077,14 +1086,17 @@ pico4_station_control_step(struct pico4_station_control *c, int64_t now_ms, char int r = c->ops.pairing(c->ops.ctx, PICO4_STATION_UNPAIR, req.hand); snprintf(line, sizeof(line), "%s %s", result_word(r, "unpaired"), hand_name(req.hand)); } else { - struct pico4_station_controller info; + struct pico4_station_controller info, other; c->ops.get_controller(c->ops.ctx, req.hand, &info); + c->ops.get_controller(c->ops.ctx, req.hand == PICO4_STATION_HAND_LEFT ? PICO4_STATION_HAND_RIGHT : PICO4_STATION_HAND_LEFT, + &other); int r = c->ops.pairing(c->ops.ctx, PICO4_STATION_PAIR, req.hand); snprintf(line, sizeof(line), "%s %s", result_word(r, "pairing"), hand_name(req.hand)); if (r == 0) { c->pairing = true; c->hand = req.hand; c->connects = info.connects; + c->other_connects = other.connects; c->deadline_ms = now_ms + (int64_t)req.seconds * 1000; return answer(c, line, log, size); } diff --git a/phoenix/pico4-monado/pico4_station.h b/phoenix/pico4-monado/pico4_station.h index 1e5d23f..e3a8e58 100644 --- a/phoenix/pico4-monado/pico4_station.h +++ b/phoenix/pico4-monado/pico4_station.h @@ -334,7 +334,9 @@ pico4_station_pairing(struct pico4_station *st, enum pico4_station_pairing op, e * * - `pair left|right [SECONDS]`: enter pairing for 1-600 s (60 unless given); answers * `pairing HAND`, then, once pairing has stopped, `paired HAND SERIAL` or `timeout HAND`. A - * client that hangs up meanwhile stops the pairing. + * client that hangs up meanwhile stops the pairing. The other hand's controller connecting + * meanwhile (it reconnects by itself) answers `connected HAND SERIAL`, and the pairing goes on: + * a client that waits for the pairing would not learn of it otherwise. * - `unpair left|right`: answers `unpaired HAND`. * - `status`: answers `left connected SERIAL` or `left disconnected`, a newline, the same for right. * diff --git a/phoenix/pico4-monado/pico4_ui.hpp b/phoenix/pico4-monado/pico4_ui.hpp index e66fa94..29c993f 100644 --- a/phoenix/pico4-monado/pico4_ui.hpp +++ b/phoenix/pico4-monado/pico4_ui.hpp @@ -316,13 +316,23 @@ struct Frame double now = 0; //!< for what moves (spinners, the caret) }; -//! The panel's background. +//! The panel's corners, rounded as the client's window's. +constexpr double kPanelR = 32; + +/*! + * The panel's background, its corners round: outside them the panel is clear (SteamVR blends the + * texture's alpha), and all that is drawn after stays inside (the clip stays until the end). + */ inline void background(cairo_t *c, const Frame &f) { + cairo_set_operator(c, CAIRO_OPERATOR_CLEAR); + cairo_paint(c); + cairo_set_operator(c, CAIRO_OPERATOR_OVER); + pico4_overlay::rounded(c, 0, 0, f.w, f.h, kPanelR); + cairo_clip(c); set(c, kBg); - cairo_rectangle(c, 0, 0, f.w, f.h); - cairo_fill(c); + cairo_paint(c); } /*! diff --git a/phoenix/pico4-monado/pico4_ui_hits.h b/phoenix/pico4-monado/pico4_ui_hits.h index e9b6b43..7c16f7a 100644 --- a/phoenix/pico4-monado/pico4_ui_hits.h +++ b/phoenix/pico4-monado/pico4_ui_hits.h @@ -88,6 +88,24 @@ pico4_list_scroll(int first, int delta, int visible, int count) return to < 0 ? 0 : to; } +/*! + * Whole steps from SteamVR's smooth scrolling (VREvent_ScrollSmooth, the thumbstick held over a + * panel): its deltas come each frame, 1.0 a wheel's notch (as gamescope takes them), and add up in + * @p acc until a step is whole; the rest waits for the next. Turning back drops what the other way + * had gathered. Positive is up, or left. + */ +static inline int +pico4_scroll_steps(float *acc, float delta) +{ + if ((delta > 0 && *acc < 0) || (delta < 0 && *acc > 0)) { + *acc = 0; + } + *acc += delta; + const int steps = (int)*acc; // toward zero + *acc -= (float)steps; + return steps; +} + //! The first row that shows @p row, from @p first, with @p visible rows shown of @p count: the chosen row in view. static inline int pico4_list_reveal(int first, int row, int visible, int count) diff --git a/phoenix/pico4-monado/test_pico4_onboarding.c b/phoenix/pico4-monado/test_pico4_onboarding.c index 47ab7d0..2c9b9e2 100644 --- a/phoenix/pico4-monado/test_pico4_onboarding.c +++ b/phoenix/pico4-monado/test_pico4_onboarding.c @@ -51,6 +51,10 @@ main(void) EXPECT(pico4_pairing_answer("timeout left") == -1); EXPECT(pico4_pairing_answer("refused right") == -1); EXPECT(pico4_pairing_answer("paired left TESTSERIAL0000001 (pairing not stopped)") == 1); + // The other hand reconnecting while one is listened for. + EXPECT(pico4_pairing_connected("connected left TESTSERIAL0000001") == 1); + EXPECT(pico4_pairing_connected("connected right TESTSERIAL0000002") == 2); + EXPECT(pico4_pairing_connected("connected rightish") == 0 && pico4_pairing_connected("paired left X") == 0); bool left = false, right = true; EXPECT(pico4_pairing_parse_status("left connected TESTSERIAL0000001\nright disconnected", &left, &right)); EXPECT(left && !right); diff --git a/phoenix/pico4-monado/test_pico4_settings.c b/phoenix/pico4-monado/test_pico4_settings.c index db1a21c..75a5485 100644 --- a/phoenix/pico4-monado/test_pico4_settings.c +++ b/phoenix/pico4-monado/test_pico4_settings.c @@ -127,6 +127,12 @@ main(void) EXPECT(pico4_list_scroll(0, 1, 4, 31) == 1 && pico4_list_scroll(0, -1, 4, 31) == 0 && pico4_list_scroll(27, 1, 4, 31) == 27); EXPECT(pico4_list_scroll(0, 1, 4, 3) == 0); // fewer rows than the window EXPECT(pico4_list_reveal(0, 10, 4, 31) == 7 && pico4_list_reveal(8, 3, 4, 31) == 3 && pico4_list_reveal(2, 4, 4, 31) == 2); + // Smooth scrolling's deltas add up to whole steps; turning back starts afresh. + float acc = 0; + EXPECT(pico4_scroll_steps(&acc, 0.4f) == 0 && pico4_scroll_steps(&acc, 0.4f) == 0 && pico4_scroll_steps(&acc, 0.4f) == 1); + EXPECT(acc > 0.19f && acc < 0.21f); + EXPECT(pico4_scroll_steps(&acc, 2.5f) == 2); + EXPECT(pico4_scroll_steps(&acc, -0.6f) == 0 && pico4_scroll_steps(&acc, -0.6f) == -1); if (failures != 0) { printf("%d failure(s)\n", failures); diff --git a/phoenix/pico4-monado/test_pico4_tracking.c b/phoenix/pico4-monado/test_pico4_tracking.c index 0c71df5..f79a38b 100644 --- a/phoenix/pico4-monado/test_pico4_tracking.c +++ b/phoenix/pico4-monado/test_pico4_tracking.c @@ -929,6 +929,25 @@ test_station_control(void) EXPECT(strcmp(got, "timeout left") == 0 && s.count == 2 && s.ops[1] == PICO4_STATION_PAIR_STOP); close(fd); + // The other hand reconnecting while the right one is paired: told once, and the pairing goes on. + s.count = 0; + fd = control_client(c, path, "pair right 30", log, sizeof(log)); + control_answer(fd, got, sizeof(got)); + EXPECT(pico4_station_control_step(c, 1500, log, sizeof(log)) == 0); // the left one, connected before + s.controllers[0].connects = 5; + EXPECT(pico4_station_control_step(c, 2000, log, sizeof(log)) > 0); + control_answer(fd, got, sizeof(got)); + EXPECT(strcmp(got, "connected left TESTSERIAL0000001") == 0 && s.count == 1); + EXPECT(pico4_station_control_step(c, 2500, log, sizeof(log)) == 0); + s.controllers[1].connected = true; + s.controllers[1].connects = 1; + snprintf(s.controllers[1].serial, sizeof(s.controllers[1].serial), "TESTSERIAL0000002"); + EXPECT(pico4_station_control_step(c, 3000, log, sizeof(log)) > 0); + control_answer(fd, got, sizeof(got)); + EXPECT(strcmp(got, "paired right TESTSERIAL0000002") == 0 && s.count == 2 && s.ops[1] == PICO4_STATION_PAIR_STOP); + close(fd); + s.controllers[1] = (struct pico4_station_controller){0}; + // A client that hangs up stops the pairing; nothing is sent to it. s.count = 0; fd = control_client(c, path, "pair right", log, sizeof(log)); From 21fc0b712e3098e93fd8d6c27902c8bb5d392f29 Mon Sep 17 00:00:00 2001 From: Xenolphthalein <21215869+Xenolphthalein@users.noreply.github.com> Date: Wed, 2 Dec 2026 20:22:03 +0100 Subject: [PATCH 8/9] fix(pico4-session): SteamVR outlasts a long first-run setup Without the Steam client, vrserver tries Steam's API every half second, and each try loads steamclient.so, which takes a thread key it never gives back: after about nine minutes all 1024 are gone and the next client that connects crashes vrserver (the setup's last step). The API finds the library only through ~/.steam/sdkarm64, which the client's RUNSTEAM.sh makes at each start; while the setup holds the client back, steamvr.service now removes it first (wait-first-run --before-steamvr), as on a new installation. --- .../pico4-session/54-pico4-onboarding.conf | 4 +++ phoenix/pico4-session/PKGBUILD | 8 ++--- phoenix/pico4-session/test_first_run_setup.py | 31 +++++++++++++++++-- phoenix/pico4-session/wait-first-run | 24 ++++++++++++-- 4 files changed, 58 insertions(+), 9 deletions(-) diff --git a/phoenix/pico4-session/54-pico4-onboarding.conf b/phoenix/pico4-session/54-pico4-onboarding.conf index e9f8b4b..303ac80 100644 --- a/phoenix/pico4-session/54-pico4-onboarding.conf +++ b/phoenix/pico4-session/54-pico4-onboarding.conf @@ -1,3 +1,7 @@ # The first-run setup runs with SteamVR (docs/session.md#first-run-setup). [Unit] Wants=pico4-onboarding.service +[Service] +# SteamVR without the Steam client, which waits for the setup: its server's tries of Steam's API +# must not load the client's library (wait-first-run says why). +ExecStartPre=/usr/libexec/pico4/wait-first-run --before-steamvr diff --git a/phoenix/pico4-session/PKGBUILD b/phoenix/pico4-session/PKGBUILD index cf1227e..398d1f4 100644 --- a/phoenix/pico4-session/PKGBUILD +++ b/phoenix/pico4-session/PKGBUILD @@ -6,7 +6,7 @@ # build puts into the user's home and SteamVR's remapping. The preset enables the session; the tests run in # the build. pkgname=pico4-session -pkgver=2026.11.22 +pkgver=2026.12.2 pkgrel=1 pkgdesc="PICO 4 session: Valve's VR session started without a display manager, with SteamVR and Steam set up for the PICO 4" arch=(any) @@ -87,7 +87,7 @@ sha256sums=('6dd8cda751033318aca350f3dbbed8a29860431777488b4acc042e8f1b9572b3' '964f3cd570156b50409418e15e55ddd40837d4f2aa6577ad1c79c3eb571da35a' 'a9ee51a475a8bd527571fa2e36d041ba524ae90f263f3bb7b41246599e50b7e6' 'e9d245af21038b0db990d91ea1fccb9f5d08f8d2b0387e9188d509136e651f8c' - '6bdba9c16de2f3306888f3981b41017ab6919deed2aef14938889d0a40580ee3' + 'b8299c7143250f40ac59c11adbb5289a506860a7b05c804fc54398c50668b41b' 'c6b8afb5512eefc540c194e288a21214153a470cc7e4e7053526da0ee63ce744' 'dc79f563ac46c680ff26a52d01a97ac3e1fb47c748ab52e52465316f9fb105de' '558048fb79304748a7fb83bf8c57dab7514e95dd746edf6e163b8fbae22e5722' @@ -99,7 +99,7 @@ sha256sums=('6dd8cda751033318aca350f3dbbed8a29860431777488b4acc042e8f1b9572b3' '1e781ed5da2cded1a92e0e1d5d557e4da929b4aeddad829f9248e81a57bf5177' 'aba5b1ad42e2b45361de4db3d5f4adfe590027b590dfc3979c3f1f54b4e1410f' '4b4e905dec0723375b9af255225a1c8417fc633314807851cf7edb4d853b317e' - '54fcd4dd29bd83a5fed18e801014343764d9121caf9379fe5f058301110cb984' + '964bd63cab06b8eb51b9a5451e01684ca1c906a8398447d76eda3a3e28e60971' 'bb98e4cdcb830378eac146680f815de362097e217da8a474c682606e694aed98' '5a154fdb20619c372a353ab650aa7a55048a31860590c823a33f55ea01f7242b' '93975c1d0aadb1c988c8b85c15ec7b3df3e4319f232058ab12b1fe0409aab945' @@ -109,7 +109,7 @@ sha256sums=('6dd8cda751033318aca350f3dbbed8a29860431777488b4acc042e8f1b9572b3' '6d82af321ff0d4987f0c8e58f02b8d0bce90904b9e53c6d7321d478bfeac805f' '6ec565db07ed8b08cdfac49afada3f319a4c010c225635fb6062c6f5310f3883' '0d023d0e215d653db55842eb38a033a453560899385a774bea4edf6c11f5ae2e' - 'fb6e493979863bb31fbfc8e8fc12f25a5f3fabd6bf36f4ef2360cafca1d905e0' + 'e9c026dfdd85468ac90e6b71a87ac1a2d00332a1437c20e39ff7ebf3fd475724' 'f1ccf770b2bca31d4e4e9fc5eaf74cf686b6795febdac0e968bba34daf3b67e6') build() { diff --git a/phoenix/pico4-session/test_first_run_setup.py b/phoenix/pico4-session/test_first_run_setup.py index a383174..6282939 100644 --- a/phoenix/pico4-session/test_first_run_setup.py +++ b/phoenix/pico4-session/test_first_run_setup.py @@ -132,11 +132,11 @@ def test_only_the_clients_languages(self): class WaitTests(unittest.TestCase): SCRIPT = HERE / "wait-first-run" - def run_script(self, home: str, *args: str) -> int: + def run_script(self, home: str, *args: str, path: str = "/usr/bin:/bin") -> int: assert BASH is not None # the tests are skipped without bash return subprocess.run( # noqa: S603 # bash from PATH runs the script under test [BASH, str(self.SCRIPT), *args], # bash from PATH - env={"HOME": home, "PATH": "/usr/bin:/bin"}, + env={"HOME": home, "PATH": path}, capture_output=True, timeout=10, check=False, @@ -170,6 +170,33 @@ def test_the_checks_ask_whether_it_is_pending(self): self.assertEqual(self.run_script(home, "--pending"), 1) self.assertEqual(self.run_script(home, "--other"), 2) + def test_steamvr_starts_without_the_clients_library_while_the_setup_waits(self): + with tempfile.TemporaryDirectory() as home: + link = Path(home) / ".steam/sdkarm64" + link.parent.mkdir() + try: + link.symlink_to(Path(home) / "Steam/linuxarm64") + except OSError: + self.skipTest("this host makes no symbolic links") + # The client runs (the setup's panel failed): its link stays. + fake = Path(home) / "bin/systemctl" + fake.parent.mkdir() + fake.write_text("#!/bin/sh\nexit 0\n", encoding="utf-8") + fake.chmod(0o755) + self.assertEqual(self.run_script(home, "--before-steamvr", path=f"{fake.parent}:/usr/bin:/bin"), 0) + self.assertTrue(link.is_symlink()) + # The setup waits and the client with it: the link goes. + fake.write_text("#!/bin/sh\nexit 3\n", encoding="utf-8") + self.assertEqual(self.run_script(home, "--before-steamvr", path=f"{fake.parent}:/usr/bin:/bin"), 0) + self.assertFalse(link.is_symlink()) + # The setup is over: nothing to do. + link.symlink_to(Path(home) / "Steam/linuxarm64") + mark = Path(home) / ".local/share/pico4/setup-done" + mark.parent.mkdir(parents=True) + mark.write_text("1\n", encoding="utf-8") + self.assertEqual(self.run_script(home, "--before-steamvr"), 0) + self.assertTrue(link.is_symlink()) + @unittest.skipIf(NO_BASH, "runs bash scripts: needs bash on PATH (Git's on Windows, not WSL's)") class TimezoneTests(unittest.TestCase): diff --git a/phoenix/pico4-session/wait-first-run b/phoenix/pico4-session/wait-first-run index f541521..38b29cb 100644 --- a/phoenix/pico4-session/wait-first-run +++ b/phoenix/pico4-session/wait-first-run @@ -5,9 +5,18 @@ # (the client's CompletedOOBE), or when the setup's panel failed for good, so that a broken # panel never keeps the client from starting. # -# wait-first-run wait (steam.service's ExecStartPre) -# wait-first-run --pending exit 0 if the setup still holds the client back, 1 if not -# (the checks, as root with HOME set to the user's home) +# wait-first-run wait (steam.service's ExecStartPre) +# wait-first-run --pending exit 0 if the setup still holds the client back, 1 if not +# (the checks, as root with HOME set to the user's home) +# wait-first-run --before-steamvr while the setup holds the client back, remove the client's +# link to its API library (steamvr.service's ExecStartPre) +# +# Without the client, SteamVR's server tries Steam's API every half second, and each try loads +# the client's library, which takes a thread key that is never given back: after about nine +# minutes all 1024 are gone, and the next program that connects to the server crashes it (the +# setup's last step, the client itself). The API finds the library only through +# ~/.steam/sdkarm64, which the client's RUNSTEAM.sh makes at each start; until then the tries +# fail before loading anything, as on a new installation, where the client has never started. set -euo pipefail mark=${HOME}/.local/share/pico4/setup-done registry=${HOME}/.steam/registry.vdf @@ -20,6 +29,15 @@ case ${1:-} in pending exit ;; +--before-steamvr) + # A client that runs already (the setup's panel failed) keeps its link. + if pending && ! systemctl --user is-active --quiet steam.service 2>/dev/null && + [[ -L ${HOME}/.steam/sdkarm64 ]]; then + rm -f "${HOME}/.steam/sdkarm64" + echo "wait-first-run: Steam's API stays off until the client starts after the setup" + fi + exit 0 + ;; "") ;; *) echo "usage: $0 [--pending]" >&2 From 56513c8392b1f9b7289019b18c1f276c31a4d504 Mon Sep 17 00:00:00 2001 From: Xenolphthalein <21215869+Xenolphthalein@users.noreply.github.com> Date: Wed, 2 Dec 2026 21:21:10 +0100 Subject: [PATCH 9/9] style(overpressure-base): the updater's test as ruff formats it --- common/overpressure-base/PKGBUILD | 2 +- common/overpressure-base/test_config.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/common/overpressure-base/PKGBUILD b/common/overpressure-base/PKGBUILD index fd0ce75..7525fe5 100644 --- a/common/overpressure-base/PKGBUILD +++ b/common/overpressure-base/PKGBUILD @@ -71,7 +71,7 @@ sha256sums=('952324c99b08f87f6d318258eb24915ed4f18a4f9fa219e756bbca70d5bd8396' '42e864cce089ddec10704c74a404d4713e9b1371284e88e29c8a396f43e0bf42' '7e2e20deeb0a824f77178be78dd3b52ba3b0eea92723b634279adc2c5e0d38b7' '3daf42f9b44dfcf6d4ae65018d633198503fa9071596c443a188fe37ec379d78' - '39cdf80928754e7e952cd75608a56f2ed2154351d6a5ba30abfa254c16396c59' + 'c7dd064ee8c73ae16f18be269c41411820408678cd467e4324cd2414a3b3897e' 'f5f3580f84c53379b59a4de7aa206ba88975a439939a4b8eded66bd5dcced147' '7983dff5891f654806fdf7b0ac36683df4b13d8ae291e439c3a90ee5abb5ab4e' 'b45bf0dbde89f82a75cd782acce1773f1e2b7d2b0322d66be50c71782dac0eea' diff --git a/common/overpressure-base/test_config.py b/common/overpressure-base/test_config.py index 313a279..e9e9422 100644 --- a/common/overpressure-base/test_config.py +++ b/common/overpressure-base/test_config.py @@ -98,8 +98,12 @@ def test_the_session_starts_the_three_steps_and_nothing_else(self): def test_the_package_installs_them(self): pkgbuild = (HERE / "PKGBUILD").read_text(encoding="utf-8") - for name in ("overpressure-update@.service", "overpressure-update-check.service", - "overpressure-update-check.timer", "50-overpressure-update.rules"): + for name in ( + "overpressure-update@.service", + "overpressure-update-check.service", + "overpressure-update-check.timer", + "50-overpressure-update.rules", + ): self.assertIn(f" {name}", pkgbuild) self.assertIn('"$pkgdir/usr/share/polkit-1/rules.d/50-overpressure-update.rules"', pkgbuild)