[PR #2023] [MERGED] Official mod: Zoom, the zoom extra as a mod #3947

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

📋 Pull Request Information

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

Base: main ← Head: feat/official-zoom-mod


📝 Commits (5)

  • 2e05b11 Merge remote-tracking branch 'origin/feat/official-hud-mods' into feat/official-zoom-mod
  • 53289d3 Official mod: Zoom, the zoom extra as a mod
  • e372fce Merge branch 'feat/mod-ui-key' into feat/official-zoom-mod
  • 8fdb27f Zoom: the game lists its key on the settings page, as "Zoom key: Z"
  • c8d75a7 Merge main into feat/official-zoom-mod

📊 Changes

6 files changed (+176 additions, -2 deletions)

View changed files

📝 Cargo.lock (+7 -0)
📝 Cargo.toml (+1 -1)
📝 docs/mods.md (+2 -1)
➕ mods/official/zoom/Cargo.toml (+16 -0)
➕ mods/official/zoom/horizon-mod.toml (+9 -0)
➕ mods/official/zoom/src/lib.rs (+141 -0)

📄 Description

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

Stacked on #2016 (players rebind mod keys), #2013 (zoom and the wheel) and #1982 (the official FPS Counter and Keystrokes, merged into this branch). Review only Official mod: Zoom and the commit after it. Until those merge, the diff also shows their commits.

Zoom is the third extra to become an official mod, after the FPS counter and Keystrokes. The built-in zoom is removed in a follow-up PR, with the same one-time migration as #1995: a player who had it on gets the mod installed and turned on, with their settings and key.

What players get

mods/official/zoom (id zoom, capabilities render, input, ui, storage) behaves as the extra does:

  • Hold the key (Z by default) to zoom in at the starting zoom. While held, the mouse wheel zooms further in or out (×1.25 a step, between 1.25 and 10) and the hotbar doesn't move. Let go and the view returns.
  • The zoom lets go when a screen opens, and through a spyglass the spyglass's own view wins.
  • The settings page has the extra's four options: Zoom key: Z (the game's key row from #2016, saved in horizon-mods.txt), Starting zoom (2x, 3x, 4x, 6x, 8x, 10x; default 4x), Smooth zoom (ON), Slower turning (ON). The options are kept in the mod's storage (level, smooth, sensitivity), where the migration will write a player's old extra settings. docs/mods.md lists them.

Identical behaviour and look

Same game build and world (seed 42, server thread), three variants: no zoom, the built-in extra, and the mod:

  • Screenshots, HUD hidden (idle; Z held 2 s; then 3 wheel steps; after opening and closing the inventory; released). Built-in vs mod: mean pixel difference 0.000–0.001. With non-default settings (instant, 8x, no slower turning): 0.000–0.008.
  • Turning while held: mouse-move 200 turns 3.84° with both, which is 30°/(4×1.25³). With slower turning off, both turn the full 30°.
  • The hotbar stays put under the wheel while the key is held, with both.
  • The settings page in game: the four rows, and each button cycles and saves (level 6, smooth false, sensitivity false).

Cost

  • Per frame, uncapped (3 rounds × 30 s, CPU frame time): no zoom 0.625 ms, built-in 0.622 ms, mod 0.635 ms. Round to round each variant moves by ±0.03 ms, so the difference is within noise.
  • Microbenchmark (Mods::frame with the mod loaded, key up): 0.40 µs per frame, against 1.26 µs for Keystrokes.

Self-check against #2016's head. The scope counts #1982's two mods, which this branch merges; the Zoom mod itself is mods/official/zoom (166 lines) plus the workspace line and the docs row:

pr_ready (tools/pr_ready.py --quick --base 3e3c0cebb on ludovics-mac-mini, against 3e3c0cebb at 3e3c0cebb, 5 min 2 s)

Check Result
Scope ⚠️ 12 files, +578 −1; 562 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ changes with a Cargo.toml
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (7 s)
clippy ✅ (43 s)
tests: workspace ✅ 2120 passed (3 min 37 s)
doc tests ✅ 1 passed (34 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 335 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 323 more

skip-release: nobody runs it until it's in the registry, and the removal PR is the player-facing change.

Publishing

Once this is on main, the maintainer builds it (cd mods/official/zoom && cargo horizon-mod build) and opens the horizon-mods PR with mods/zoom.toml, as for the other two.

🤖 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/2023 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/official-zoom-mod` --- ### 📝 Commits (5) - [`2e05b11`](https://github.com/horizon-rust/horizon/commit/2e05b11a4dee7f166489c290085f2681f33f4c7f) Merge remote-tracking branch 'origin/feat/official-hud-mods' into feat/official-zoom-mod - [`53289d3`](https://github.com/horizon-rust/horizon/commit/53289d3565bb70df52876cc8cf23603a54901eb5) Official mod: Zoom, the zoom extra as a mod - [`e372fce`](https://github.com/horizon-rust/horizon/commit/e372fce7ab4ba145c3531594bc51c476b63b6c5c) Merge branch 'feat/mod-ui-key' into feat/official-zoom-mod - [`8fdb27f`](https://github.com/horizon-rust/horizon/commit/8fdb27f9493ff31a664f3c6683e5ce8c57dd7084) Zoom: the game lists its key on the settings page, as "Zoom key: Z" - [`c8d75a7`](https://github.com/horizon-rust/horizon/commit/c8d75a7892842de64f5c00c526987fda440c554e) Merge main into feat/official-zoom-mod ### 📊 Changes **6 files changed** (+176 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+7 -0) 📝 `Cargo.toml` (+1 -1) 📝 `docs/mods.md` (+2 -1) ➕ `mods/official/zoom/Cargo.toml` (+16 -0) ➕ `mods/official/zoom/horizon-mod.toml` (+9 -0) ➕ `mods/official/zoom/src/lib.rs` (+141 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. **Stacked on #2016** (players rebind mod keys), #2013 (zoom and the wheel) and #1982 (the official FPS Counter and Keystrokes, merged into this branch). Review only `Official mod: Zoom` and the commit after it. Until those merge, the diff also shows their commits. Zoom is the third extra to become an official mod, after the FPS counter and Keystrokes. The built-in zoom is removed in a follow-up PR, with the same one-time migration as #1995: a player who had it on gets the mod installed and turned on, with their settings and key. ## What players get `mods/official/zoom` (id `zoom`, capabilities render, input, ui, storage) behaves as the extra does: - Hold the key (Z by default) to zoom in at the starting zoom. While held, the mouse wheel zooms further in or out (×1.25 a step, between 1.25 and 10) and the hotbar doesn't move. Let go and the view returns. - The zoom lets go when a screen opens, and through a spyglass the spyglass's own view wins. - The settings page has the extra's four options: **Zoom key: Z** (the game's key row from #2016, saved in `horizon-mods.txt`), **Starting zoom** (2x, 3x, 4x, 6x, 8x, 10x; default 4x), **Smooth zoom** (ON), **Slower turning** (ON). The options are kept in the mod's storage (`level`, `smooth`, `sensitivity`), where the migration will write a player's old extra settings. `docs/mods.md` lists them. ## Identical behaviour and look Same game build and world (seed 42, server thread), three variants: no zoom, the built-in extra, and the mod: - **Screenshots, HUD hidden** (idle; Z held 2 s; then 3 wheel steps; after opening and closing the inventory; released). Built-in vs mod: mean pixel difference 0.000–0.001. With non-default settings (instant, 8x, no slower turning): 0.000–0.008. - **Turning while held:** `mouse-move 200` turns 3.84° with both, which is 30°/(4×1.25³). With slower turning off, both turn the full 30°. - **The hotbar** stays put under the wheel while the key is held, with both. - **The settings page** in game: the four rows, and each button cycles and saves (`level` 6, `smooth` false, `sensitivity` false). ## Cost - **Per frame, uncapped** (3 rounds × 30 s, CPU frame time): no zoom 0.625 ms, built-in 0.622 ms, mod 0.635 ms. Round to round each variant moves by ±0.03 ms, so the difference is within noise. - **Microbenchmark** (`Mods::frame` with the mod loaded, key up): 0.40 µs per frame, against 1.26 µs for Keystrokes. **Self-check** against #2016's head. The scope counts #1982's two mods, which this branch merges; the Zoom mod itself is `mods/official/zoom` (166 lines) plus the workspace line and the docs row: **pr_ready** (`tools/pr_ready.py --quick --base 3e3c0cebb` on ludovics-mac-mini, against 3e3c0cebb at 3e3c0cebb, 5 min 2 s) | Check | Result | | --- | --- | | Scope | ⚠️ 12 files, +578 −1; 562 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ changes with a Cargo.toml | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (7 s) | | clippy | ✅ (43 s) | | tests: workspace | ✅ 2120 passed (3 min 37 s) | | doc tests | ✅ 1 passed (34 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 335 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 323 more | `skip-release`: nobody runs it until it's in the registry, and the removal PR is the player-facing change. ## Publishing Once this is on `main`, the maintainer builds it (`cd mods/official/zoom && cargo horizon-mod build`) and opens the horizon-mods PR with `mods/zoom.toml`, as for the other two. 🤖 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:13:29 +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#3947
No description provided.