From b8b353c92e06d1795b5b51ab7bd5a7e143dbe78b Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Tue, 27 Oct 2026 03:35:07 +0100 Subject: [PATCH] launcher: import a file dropped anywhere on the window A file dropped on the window goes where it belongs: - a shared instance becomes a new instance, which gets selected on Home; - a Java modpack goes to the Modpacks import; - a resource or shader pack goes into the selected instance; - a data pack points to the world rows. A note in the corner says what happened, until it is closed. The Packs section and the world rows still take their own drops, and now stop the drop there so it isn't imported twice. Co-Authored-By: Claude Opus 5.5 --- launcher/README.md | 8 ++ launcher/src/datapacks_page.rs | 2 + launcher/src/import_page.rs | 132 +++++++++++++++++++++++++++++++++ launcher/src/instances_page.rs | 2 +- launcher/src/main.rs | 5 ++ launcher/src/modpacks_page.rs | 2 +- launcher/src/packs_page.rs | 2 + 7 files changed, 151 insertions(+), 2 deletions(-) create mode 100644 launcher/src/import_page.rs diff --git a/launcher/README.md b/launcher/README.md index ea5cc449b..7ffcc210a 100644 --- a/launcher/README.md +++ b/launcher/README.md @@ -92,6 +92,14 @@ The opening, then Play ([clip](docs/opening.webm)): a world goes without `playerdata/`, `stats/` and `advancements/`, and its level.dat without the player's UUID. `horizon-launcher instance export [] [--format mrpack|zip] [--world ]… [--out ]`. +- **Import by dropping a file**: a file dropped anywhere on the window is imported for what it is + (`horizon_launcher::import`). A shared instance (a `.mrpack` that needs no mod loader, such as + Export writes, or a game folder `.zip`) becomes a new instance, opened on Home. Its `.mrpack` + downloads come from Modrinth with their SHA-512 checked, and only what an instance keeps is + taken, inside its folder. A Java modpack goes to the Modpacks import, and a resource or shader + pack into the selected instance. A data pack is pointed at the world rows, and the Packs section + and the world rows keep taking their own drops. A note in the corner says what happened. + `horizon-launcher instance import `. - **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 (`_