[PR #7860] Packs: browse and install resource packs from the pack screen #7867

Open
opened 2026-11-03 07:25:46 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7860
Author: @itarqos5
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: feat/pack-browser-screen


📝 Commits (2)

  • cc6742f feat(packs): a Modrinth client for resource packs
  • 1346da6 feat(packs): browse and install resource packs from the pack screen

📊 Changes

13 files changed (+1317 additions, -13 deletions)

View changed files

📝 crates/horizon-client-render/src/extras.rs (+8 -1)
📝 crates/horizon-client-render/src/lib.rs (+1 -0)
📝 crates/horizon-client-render/src/options_ui.rs (+10 -0)
➕ crates/horizon-client-render/src/pack_browser.rs (+642 -0)
📝 crates/horizon-client-render/src/pack_screen.rs (+521 -4)
📝 crates/horizon-client-render/src/screen_draw.rs (+24 -0)
📝 crates/horizon-client/assets/horizon/lang/en_us.json (+19 -2)
📝 crates/horizon-client/src/client_lib.rs (+2 -1)
📝 crates/horizon-client/src/game.rs (+33 -5)
📝 crates/horizon-client/src/game/options.rs (+10 -0)
📝 crates/horizon-client/src/game/packs.rs (+38 -0)
📝 crates/horizon-client/src/game/server_packs.rs (+1 -0)
📝 crates/horizon-client/src/game/startup_menu.rs (+8 -0)

📄 Description

🤖 Opened by itarqos5's AI agent (Claude Opus 5), not by itarqos5 personally.

Stacked on #7857 (the Modrinth client), which it uses. Review that one first — this diff shows both until it merges. Icons need #7856 as well, since many Modrinth icons are WebP; without it the cards simply have no icon.

An Add button beside the search box on Select Resource Packs opens a screen that searches Modrinth, shows the results and installs one into the packs folder. The available list refreshes without the screen closing, so the pack can be turned on immediately.

Off by default, and that is deliberate

The pack screen is otherwise vanilla's, and tools/test_pack_screen_parity.py compares it against vanilla. Per AGENTS.md, a Horizon-only feature that changes the vanilla look is off by default, so this sits behind a new packBrowser extra. With the extra off nothing is drawn and the screen's output is unchanged — the button, the screen and every click path are gated on it.

The screen

Sidebar of category and resolution filters, its own search box, and one card per pack: icon, bold name, author, description, and an Install button that reads Installing then Installed. Two columns where the window has room, one where it does not.

The layout is pinned by a test rather than checked by eye — the name column ends before Install begins, and the description starts below the icon, at both widths. An earlier revision had the description drawn straight across the icon.

Backdrop

New in screen_draw: a screen states which background it wants and Game::shows_panorama honours it. The panorama is a cube the renderer draws before the HUD, so a draw list cannot contain one — a screen has to ask. The two cases that always had a panorama are untouched, and any screen leaving Backdrop::None behaves exactly as before. Menu only: in a world it would replace the world the player is standing in.

This exists so the next Horizon screen that wants one does not need its own branch in shows_panorama.

Memory

Downloaded icons are freed when the browser closes. Each is 64 KiB and a search brings twenty, so left in the pack screen's icon map they accumulated for the whole session.

Checks

  • cargo test -p horizon-client-render --lib -- pack_screen pack_browser — 14 passed, 0 failed, 1 ignored
  • cargo check -p horizon-client — clean
  • Not a full tools/pr_ready.py run, and the pack screen parity harness was not run here — it needs the vanilla data. It is the one a reviewer should run, even though the gate means the drawn output should be untouched with the extra off.

Known gaps

  • Square corners and no shadows: the draw list has rectangle fills and nine-slice sprites, no rounded-rect primitive
  • No pagination or scrolling in the results; it shows what fits
  • Cards have no banner image, only the icon

It is ~670 lines, above the small-PR guideline. Splitting it further would leave halves that do not do anything on their own, but I am happy to cut it differently if a reviewer prefers.

🤖 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/7860 **Author:** [@itarqos5](https://github.com/itarqos5) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/pack-browser-screen` --- ### 📝 Commits (2) - [`cc6742f`](https://github.com/horizon-rust/horizon/commit/cc6742f38195a4a8226cd7a21374c4d8d1ecec0d) feat(packs): a Modrinth client for resource packs - [`1346da6`](https://github.com/horizon-rust/horizon/commit/1346da6bfa7f88319bae6b5baba41790c0b29546) feat(packs): browse and install resource packs from the pack screen ### 📊 Changes **13 files changed** (+1317 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/extras.rs` (+8 -1) 📝 `crates/horizon-client-render/src/lib.rs` (+1 -0) 📝 `crates/horizon-client-render/src/options_ui.rs` (+10 -0) ➕ `crates/horizon-client-render/src/pack_browser.rs` (+642 -0) 📝 `crates/horizon-client-render/src/pack_screen.rs` (+521 -4) 📝 `crates/horizon-client-render/src/screen_draw.rs` (+24 -0) 📝 `crates/horizon-client/assets/horizon/lang/en_us.json` (+19 -2) 📝 `crates/horizon-client/src/client_lib.rs` (+2 -1) 📝 `crates/horizon-client/src/game.rs` (+33 -5) 📝 `crates/horizon-client/src/game/options.rs` (+10 -0) 📝 `crates/horizon-client/src/game/packs.rs` (+38 -0) 📝 `crates/horizon-client/src/game/server_packs.rs` (+1 -0) 📝 `crates/horizon-client/src/game/startup_menu.rs` (+8 -0) </details> ### 📄 Description > 🤖 Opened by itarqos5's AI agent (Claude Opus 5), not by itarqos5 personally. **Stacked on #7857** (the Modrinth client), which it uses. Review that one first — this diff shows both until it merges. Icons need #7856 as well, since many Modrinth icons are WebP; without it the cards simply have no icon. An **Add** button beside the search box on Select Resource Packs opens a screen that searches Modrinth, shows the results and installs one into the packs folder. The available list refreshes without the screen closing, so the pack can be turned on immediately. ## Off by default, and that is deliberate The pack screen is otherwise vanilla's, and `tools/test_pack_screen_parity.py` compares it against vanilla. Per AGENTS.md, a Horizon-only feature that changes the vanilla look is off by default, so this sits behind a new `packBrowser` extra. **With the extra off nothing is drawn and the screen's output is unchanged** — the button, the screen and every click path are gated on it. ## The screen Sidebar of category and resolution filters, its own search box, and one card per pack: icon, bold name, author, description, and an Install button that reads Installing then Installed. Two columns where the window has room, one where it does not. The layout is pinned by a test rather than checked by eye — the name column ends before Install begins, and the description starts below the icon, at both widths. An earlier revision had the description drawn straight across the icon. ## `Backdrop` New in `screen_draw`: a screen states which background it wants and `Game::shows_panorama` honours it. The panorama is a cube the renderer draws before the HUD, so a draw list cannot contain one — a screen has to ask. **The two cases that always had a panorama are untouched**, and any screen leaving `Backdrop::None` behaves exactly as before. Menu only: in a world it would replace the world the player is standing in. This exists so the next Horizon screen that wants one does not need its own branch in `shows_panorama`. ## Memory Downloaded icons are freed when the browser closes. Each is 64 KiB and a search brings twenty, so left in the pack screen's icon map they accumulated for the whole session. ## Checks - `cargo test -p horizon-client-render --lib -- pack_screen pack_browser` — **14 passed, 0 failed, 1 ignored** - `cargo check -p horizon-client` — clean - Not a full `tools/pr_ready.py` run, and **the pack screen parity harness was not run here** — it needs the vanilla data. It is the one a reviewer should run, even though the gate means the drawn output should be untouched with the extra off. ## Known gaps - Square corners and no shadows: the draw list has rectangle fills and nine-slice sprites, no rounded-rect primitive - No pagination or scrolling in the results; it shows what fits - Cards have no banner image, only the icon It is ~670 lines, above the small-PR guideline. Splitting it further would leave halves that do not do anything on their own, but I am happy to cut it differently if a reviewer prefers. 🤖 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>
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#7867
No description provided.