[PR #2032] [MERGED] horizon-ctl options-set keeps the mod list #3956

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

📋 Pull Request Information

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

Base: main ← Head: fix/ctl-options-set-mods


📝 Commits (1)

  • 130f1dc horizon-ctl options-set keeps the mod list

📊 Changes

2 files changed (+31 additions, -8 deletions)

View changed files

📝 crates/horizon-client/src/game/options.rs (+1 -8)
📝 crates/horizon-client/src/settings.rs (+30 -0)

📄 Description

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

horizon-ctl options-set (and the MCP tool that wraps it) turned every mod off.

The bug

options-set rebuilds Settings from options.txt. It carried over Horizon's own files, which options.txt doesn't hold (graphics, controller, extras), but not the mod list. After one options-set:

  • the game's mod list was empty, so the Mods page showed every mod off;
  • the next settings save wrote an empty horizon-mods.txt;
  • the next start loaded no mod.

The fix

Settings::with_option(key, value) does the rebuild and keeps all four of Horizon's files. options-set calls it, in place of the three mem::swaps.

How tested

  • Unit test an_option_set_keeps_horizon_files: after fov 90, the mod list, extras, graphics and controller settings are unchanged, and an out-of-range value is still refused.
  • In game, with a mod installed and on, in-frame and on the server thread, fresh HORIZON_HOME/XDG folders and HORIZON_NO_AUDIO=1. 10/10 checks: options-set fov 90 applies, horizon-mods.txt keeps mod.<id>:true, the mod still runs, and the Mods page still shows it on.

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 5bcc87983, 9 min 23 s)

Check Result
Scope ✅ 2 files, +31 −8
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (30 s)
clippy ✅ (2 min 53 s)
tests: horizon-client ✅ 1294 passed (4 min 20 s)
doc tests ✅ 0 passed (3 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 31 affected, to run in CI (--quick): block_removal, chat_screen, command_exec, command_parse, composter, crafter, cursor_death, dedicated_server, dispenser, game_loop, hardcore_respawn, locator_bar and 19 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

No label: a fix.

🤖 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/2032 **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:** `fix/ctl-options-set-mods` --- ### 📝 Commits (1) - [`130f1dc`](https://github.com/horizon-rust/horizon/commit/130f1dc6a5a83917bd89477414b528e640cefc6f) horizon-ctl options-set keeps the mod list ### 📊 Changes **2 files changed** (+31 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/options.rs` (+1 -8) 📝 `crates/horizon-client/src/settings.rs` (+30 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. `horizon-ctl options-set` (and the MCP tool that wraps it) turned every mod off. ## The bug `options-set` rebuilds `Settings` from `options.txt`. It carried over Horizon's own files, which `options.txt` doesn't hold (graphics, controller, extras), but not the mod list. After one `options-set`: - the game's mod list was empty, so the Mods page showed every mod off; - the next settings save wrote an empty `horizon-mods.txt`; - the next start loaded no mod. ## The fix `Settings::with_option(key, value)` does the rebuild and keeps all four of Horizon's files. `options-set` calls it, in place of the three `mem::swap`s. ## How tested - **Unit test** `an_option_set_keeps_horizon_files`: after `fov 90`, the mod list, extras, graphics and controller settings are unchanged, and an out-of-range value is still refused. - **In game**, with a mod installed and on, in-frame and on the server thread, fresh `HORIZON_HOME`/XDG folders and `HORIZON_NO_AUDIO=1`. 10/10 checks: `options-set fov 90` applies, `horizon-mods.txt` keeps `mod.<id>:true`, the mod still runs, and the Mods page still shows it on. **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 5bcc87983, 9 min 23 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +31 −8 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (30 s) | | clippy | ✅ (2 min 53 s) | | tests: horizon-client | ✅ 1294 passed (4 min 20 s) | | doc tests | ✅ 0 passed (3 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 31 affected, to run in CI (--quick): block_removal, chat_screen, command_exec, command_parse, composter, crafter, cursor_death, dedicated_server, dispenser, game_loop, hardcore_respawn, locator_bar and 19 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | No label: a fix. 🤖 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:34 +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#3956
No description provided.