[PR #409] [MERGED] Graphics presets set render and simulation distance like vanilla #2541

Closed
opened 2026-11-02 15:57:03 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/graphics-preset-distances


📝 Commits (1)

  • 5a0ad89 Graphics presets set the distances like vanilla (#382)

📊 Changes

2 files changed (+92 additions, -22 deletions)

View changed files

📝 crates/horizon-client/src/options_horizon.rs (+2 -7)
📝 crates/horizon-client/src/options_ui.rs (+90 -15)

📄 Description

Fixes #382

What vanilla does

GraphicsPreset.apply (called from Options.applyGraphicsPreset, the option's value-update callback) sets these options:

Fast Fancy Fabulous
render distance 8 16 32
simulation distance 6 12 12
prioritize chunk updates none by player by player
smooth lighting off on on
menu blur 2 5 5
cloud range 32 64 128
entity distance 0.75 1.0 1.25

It also sets biome blend, particles, mipmaps, shadows, cutout leaves, improved transparency and weather radius, which Horizon already did. Texture filtering and anisotropy aren't Horizon options yet.

What was wrong

  1. options_ui::apply_preset never set render or simulation distance, chunk-update priority, smooth lighting or menu blur. Its cloud ranges were 64/128 and Fabulous used Fancy's entity distance.
  2. The classic preset is a slider (SliderableEnum, as in vanilla). A press applied the preset where it landed, but dragging the slider only changed its label. So dragging to Fast or Fabulous changed nothing else.

Fix

apply_preset now follows GraphicsPreset.apply field by field. options_ui::set_slider applies the preset whenever its value changes, the way OptionInstance.set calls the update callback only on a change. The classic press and drag paths and the Horizon menu's slider path all use it.

Verified

  • New test options_ui::tests::classic_graphics_presets_set_the_distances: it drags the classic Video Settings preset slider across its range and sees Fast (8, 6, 32), Fancy (16, 12, 64) and Fabulous (32, 12, 128). It failed before (every step stayed fast at the press value). cargo test -p horizon-client --lib -- options_ui options_horizon graphics: 23 passed.
  • In the game, offscreen with horizon-ctl, in classic Options → Video Settings: dragging Preset from Fancy to Fabulous gave renderDistance 32, simulationDistance 12, cloudRange 128. Dragging to Fast gave 8, 6, 32, and the slider reads "Preset: Fast" (screenshot checked).

Self-check (combined branch of the batch's seven PRs, #406 #407 #409 #414 #416 #421 #423, on origin/main d28521f7; Mac mini):

  • cargo fmt --all --check: ok
  • cargo clippy --workspace --all-targets -- -D warnings: ok
  • cargo test -p horizon-client: 775 passed, 0 failed
  • tools/parity.py --changed origin/main (82 harnesses, including the new world_reopen): 82 pass.
    • The first pass found two #407 regressions, both fixed in #407 and rerun green: command_parse (suggestions were pruned in brigadier itself rather than only in the player's chat) and dedicated_server (dedicated-server guests lost their ops-based commands).
    • 34 harnesses passed on the combined commit before those two #407 fixes. The other 48 plus the two reruns passed after them.
  • Not run: the Linux and Windows checks (this batch was developed and checked on the Mac mini only).

🤖 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/409 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/16/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/graphics-preset-distances` --- ### 📝 Commits (1) - [`5a0ad89`](https://github.com/horizon-rust/horizon/commit/5a0ad89207a52df32d67ff7bef53da5dc6d6be76) Graphics presets set the distances like vanilla (#382) ### 📊 Changes **2 files changed** (+92 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/options_horizon.rs` (+2 -7) 📝 `crates/horizon-client/src/options_ui.rs` (+90 -15) </details> ### 📄 Description Fixes #382 ## What vanilla does `GraphicsPreset.apply` (called from `Options.applyGraphicsPreset`, the option's value-update callback) sets these options: | | Fast | Fancy | Fabulous | |---|---|---|---| | render distance | 8 | 16 | 32 | | simulation distance | 6 | 12 | 12 | | prioritize chunk updates | none | by player | by player | | smooth lighting | off | on | on | | menu blur | 2 | 5 | 5 | | cloud range | 32 | 64 | 128 | | entity distance | 0.75 | 1.0 | 1.25 | It also sets biome blend, particles, mipmaps, shadows, cutout leaves, improved transparency and weather radius, which Horizon already did. Texture filtering and anisotropy aren't Horizon options yet. ## What was wrong 1. `options_ui::apply_preset` never set render or simulation distance, chunk-update priority, smooth lighting or menu blur. Its cloud ranges were 64/128 and Fabulous used Fancy's entity distance. 2. The classic preset is a slider (`SliderableEnum`, as in vanilla). A press applied the preset where it landed, but dragging the slider only changed its label. So dragging to Fast or Fabulous changed nothing else. ## Fix `apply_preset` now follows `GraphicsPreset.apply` field by field. `options_ui::set_slider` applies the preset whenever its value changes, the way `OptionInstance.set` calls the update callback only on a change. The classic press and drag paths and the Horizon menu's slider path all use it. ## Verified - New test `options_ui::tests::classic_graphics_presets_set_the_distances`: it drags the classic Video Settings preset slider across its range and sees Fast (8, 6, 32), Fancy (16, 12, 64) and Fabulous (32, 12, 128). It failed before (every step stayed `fast` at the press value). `cargo test -p horizon-client --lib -- options_ui options_horizon graphics`: 23 passed. - In the game, offscreen with horizon-ctl, in classic Options → Video Settings: dragging Preset from Fancy to Fabulous gave `renderDistance 32, simulationDistance 12, cloudRange 128`. Dragging to Fast gave `8, 6, 32`, and the slider reads "Preset: Fast" (screenshot checked). **Self-check** (combined branch of the batch's seven PRs, #406 #407 #409 #414 #416 #421 #423, on origin/main d28521f7; Mac mini): - `cargo fmt --all --check`: ok - `cargo clippy --workspace --all-targets -- -D warnings`: ok - `cargo test -p horizon-client`: 775 passed, 0 failed - `tools/parity.py --changed origin/main` (82 harnesses, including the new `world_reopen`): 82 pass. - The first pass found two #407 regressions, both fixed in #407 and rerun green: `command_parse` (suggestions were pruned in brigadier itself rather than only in the player's chat) and `dedicated_server` (dedicated-server guests lost their ops-based commands). - 34 harnesses passed on the combined commit before those two #407 fixes. The other 48 plus the two reruns passed after them. - Not run: the Linux and Windows checks (this batch was developed and checked on the Mac mini only). 🤖 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-02 15:57:03 +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#2541
No description provided.