[PR #2601] [MERGED] Launcher: resource and shader packs per instance (library and CLI) #4461

Closed
opened 2026-11-03 04:17:19 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2601
Author: @ludovic111
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: feat/launcher-packs-core


📝 Commits (1)

  • ddaa514 Launcher: resource and shader packs per instance (library and CLI)

📊 Changes

8 files changed (+729 additions, -0 deletions)

View changed files

📝 docs/launcher-commands.md (+58 -0)
📝 launcher/Cargo.lock (+1 -0)
📝 launcher/Cargo.toml (+1 -0)
📝 launcher/src/cli.rs (+155 -0)
📝 launcher/src/cli_tools.rs (+1 -0)
📝 launcher/src/lib.rs (+1 -0)
➕ launcher/src/packs.rs (+338 -0)
➕ launcher/src/packs/tests.rs (+174 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Clean room: designed from the feature list in briefs/launcher-features-1.md; no other launcher's code, docs or assets were read.

Item 7 of the launcher features, part 1 of 2 (library and CLI; the Home section is the next PR). Stacked on #2599 (screenshots).

What

launcher/src/packs.rs, an instance's packs as the game finds and picks them:

  • Resource packs: resourcepacks/, each a .zip or folder with a pack.mcmeta (the game leaves out the rest, so does this). On/off is options.txt's resourcePacks list in vanilla's format ("file/<name>", bottom first), so the game's Resource Packs screen shows the same choice; a pack turned on goes on top, as the screen puts a newly picked one. Turning one off also drops it from incompatibleResourcePacks. The description is pack.mcmeta's text component as plain text, the picture pack.png.
  • Shader packs: shaderpacks/, Horizon's own (folder with horizon-shaders.toml → its name, or a .hshader) and the shaders/ format (a .zip or a folder with shaders/), with the same rules as the game's shader_pack_list. One at most is on: pickedShaderPack in horizon-graphics.txt.
  • Every other line of options.txt and horizon-graphics.txt is written back as it was; a fresh instance gets just the line.
  • add tells a dropped file's kind (zip with pack.mcmeta → resource; zip with shaders/ or .hshader → shader; anything else is refused with the reason) and copies it in under a free name (Name (2).zip); remove turns it off and moves it to the trash.

CLI: horizon-launcher packs [list|add|on|off|remove] [--kind resource|shader] [--instance <name>]. MCP tools are generated from it; packs remove needs confirm: true. docs/launcher-commands.md regenerated. New direct dependency: toml (already in the lock through other crates) for the shader manifest's name.

Proof

  • cargo fmt --check, cargo clippy --all-targets --locked --features gpui/runtime_shaders -- -D warnings: clean.
  • cargo test --locked --lib: 154 passed (3 new: what is listed and which are on; on/off writes exactly the game's lines, the rest untouched, newest on top, one shader pack; adding goes to the right folder under a free name and refuses non-packs). --bin horizon-launcher: 35 passed.
  • CLI by hand in scratch homes:
$ horizon-launcher packs on "Dark UI.zip"            → resourcePacks:["vanilla","file/Dark UI.zip"]
$ horizon-launcher packs on "Golden Hour" --kind shader   → pickedShaderPack:golden-hour
$ horizon-launcher packs add "Bright Ores.zip"        → Added Bright Ores.zip to resourcepacks (off).
$ horizon-launcher packs
resourcepacks:
  off Bright Ores.zip
  on  Clear Glass.zip
  off Dark UI.zip
  off Low Fire.zip
shaderpacks:
  off Golden Hour (golden-hour)
  on  Soft Shadows.zip

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/2601 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/launcher-packs-core` --- ### 📝 Commits (1) - [`ddaa514`](https://github.com/horizon-rust/horizon/commit/ddaa514f3aa4f15a889c8955e3563812defea08e) Launcher: resource and shader packs per instance (library and CLI) ### 📊 Changes **8 files changed** (+729 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `docs/launcher-commands.md` (+58 -0) 📝 `launcher/Cargo.lock` (+1 -0) 📝 `launcher/Cargo.toml` (+1 -0) 📝 `launcher/src/cli.rs` (+155 -0) 📝 `launcher/src/cli_tools.rs` (+1 -0) 📝 `launcher/src/lib.rs` (+1 -0) ➕ `launcher/src/packs.rs` (+338 -0) ➕ `launcher/src/packs/tests.rs` (+174 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Clean room: designed from the feature list in briefs/launcher-features-1.md; no other launcher's code, docs or assets were read. Item 7 of the launcher features, part 1 of 2 (library and CLI; the Home section is the next PR). Stacked on #2599 (screenshots). ## What `launcher/src/packs.rs`, an instance's packs as the game finds and picks them: - **Resource packs**: `resourcepacks/`, each a `.zip` or folder with a `pack.mcmeta` (the game leaves out the rest, so does this). On/off is `options.txt`'s `resourcePacks` list in vanilla's format (`"file/<name>"`, bottom first), so the game's Resource Packs screen shows the same choice; a pack turned on goes on top, as the screen puts a newly picked one. Turning one off also drops it from `incompatibleResourcePacks`. The description is `pack.mcmeta`'s text component as plain text, the picture `pack.png`. - **Shader packs**: `shaderpacks/`, Horizon's own (folder with `horizon-shaders.toml` → its `name`, or a `.hshader`) and the `shaders/` format (a `.zip` or a folder with `shaders/`), with the same rules as the game's `shader_pack_list`. One at most is on: `pickedShaderPack` in `horizon-graphics.txt`. - Every other line of `options.txt` and `horizon-graphics.txt` is written back as it was; a fresh instance gets just the line. - `add` tells a dropped file's kind (zip with `pack.mcmeta` → resource; zip with `shaders/` or `.hshader` → shader; anything else is refused with the reason) and copies it in under a free name (`Name (2).zip`); `remove` turns it off and moves it to the trash. CLI: `horizon-launcher packs [list|add|on|off|remove] [--kind resource|shader] [--instance <name>]`. MCP tools are generated from it; `packs remove` needs `confirm: true`. `docs/launcher-commands.md` regenerated. New direct dependency: `toml` (already in the lock through other crates) for the shader manifest's name. ## Proof - `cargo fmt --check`, `cargo clippy --all-targets --locked --features gpui/runtime_shaders -- -D warnings`: clean. - `cargo test --locked --lib`: 154 passed (3 new: what is listed and which are on; on/off writes exactly the game's lines, the rest untouched, newest on top, one shader pack; adding goes to the right folder under a free name and refuses non-packs). `--bin horizon-launcher`: 35 passed. - CLI by hand in scratch homes: ``` $ horizon-launcher packs on "Dark UI.zip" → resourcePacks:["vanilla","file/Dark UI.zip"] $ horizon-launcher packs on "Golden Hour" --kind shader → pickedShaderPack:golden-hour $ horizon-launcher packs add "Bright Ores.zip" → Added Bright Ores.zip to resourcepacks (off). $ horizon-launcher packs resourcepacks: off Bright Ores.zip on Clear Glass.zip off Dark UI.zip off Low Fire.zip shaderpacks: off Golden Hour (golden-hour) on Soft Shadows.zip ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:17:19 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4461
No description provided.