From ea0cc65aea9a682810358fb888a03a8d784fdd55 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Tue, 27 Oct 2026 02:02:15 +0100 Subject: [PATCH] Launcher: play time per instance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every run of the game started from the window or `horizon-launcher play` adds its length to its instance's play time in instances.json (by id, so a renamed instance keeps it), with when it ended. Home's Instance row shows "3 h 06 min in total · last played today"; `instance list` shows it too, and its JSON gives played_secs and last_played_ms. Co-Authored-By: Claude Opus 5.5 --- launcher/README.md | 8 +++--- launcher/src/cli.rs | 16 ++++++++--- launcher/src/instances.rs | 47 +++++++++++++++++++++++++++++++++ launcher/src/instances/tests.rs | 34 ++++++++++++++++++++++++ launcher/src/instances_page.rs | 26 +++++++++++++++++- launcher/src/main.rs | 29 +++++++++++++++++--- launcher/src/worlds_page.rs | 2 +- 7 files changed, 150 insertions(+), 12 deletions(-) diff --git a/launcher/README.md b/launcher/README.md index 34b7c2317..c06ffb9d4 100644 --- a/launcher/README.md +++ b/launcher/README.md @@ -78,9 +78,11 @@ The opening, then Play ([clip](docs/opening.webm)): data folder, so renaming moves nothing. Every instance follows the launcher's data collection answer and No AI. In the window, **+** beside Instances makes one, the sidebar lists them by group (click one to play it), and Home's Instance row has Edit (name, group, icon), Copy and - Open folder. Each instance plays the launcher's version, which follows updates, unless the Play - page's version picker keeps it on another installed one (to keep an old world on the version - it was made with); picking the version marked "follows updates" lets it follow again. + Open folder. The Instance row shows its play time and when it was last played: every run started + from the window or `horizon-launcher play` adds to it (`instance list` shows it too). Each + instance plays the launcher's version, which follows updates, unless the Play page's version + picker keeps it on another installed one (to keep an old world on the version it was made + with); picking the version marked "follows updates" lets it follow again. - **Worlds**: Home lists the selected instance's worlds (picture, mode, version, last played, size). **Back up** zips one into the instance's `backups/` as the game's Make Backup does (`_