[PR #3346] [MERGED] Native mods: a settings page in Options > Mods #4916

Closed
opened 2026-11-03 05:08:54 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: feat/native-mod-settings


📝 Commits (2)

  • 1149c92 Native mods: a settings page in Options > Mods
  • 01d0f45 Native mods: turn one off in Options > Mods

📊 Changes

6 files changed (+237 additions, -22 deletions)

View changed files

📝 crates/horizon-client/src/game/mods.rs (+11 -1)
📝 crates/horizon-client/src/game/native_hooks.rs (+76 -1)
📝 crates/horizon-client/src/game/options.rs (+1 -0)
📝 crates/horizon-client/src/game/startup_menu.rs (+1 -1)
📝 crates/horizon-client/src/mod_list.rs (+69 -16)
📝 crates/horizon-client/src/options_ui.rs (+79 -3)

📄 Description

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

Stacked on #3345 (hook points). This gives native mods their own settings page in Options > Mods, so the official mods keep the settings players had with the WebAssembly versions.

  • Hooks native_mods (id, title, description, keys), native_settings (the page's button labels) and native_settings_click.
  • Options > Mods:
    • A native mod has a row: always ON, since it is built into the game, with a Settings button.
    • Mod Settings page: one row per key (rebinding writes key.<id>.<name> in horizon-mods.txt, as the WebAssembly mods' keys were kept), then the mod's buttons. A click tells the mod and refreshes the labels.
  • A WebAssembly mod with the same id as a native one built into the game doesn't start. Its row says "Replaced by its native version".

Proof (Zoom, FPS Counter, Keystrokes and Minimap applied with horizon-mixins on this branch; offscreen game with horizon-ctl on fresh temporary data):

  • Options > Mods lists "Zoom 2.0.0: ON" with Settings.
  • The page shows the key (C, as the player's WebAssembly settings had it) and the three WebAssembly labels.
  • Clicks wrote level=10, smooth=true and key X into the same files.
  • FPS Counter's page shows "Corner: Bottom right" and "Minimum and 1% low: ON" from the player's files.
  • All four together are listed ON.

pr_ready: the block on #3345 covers both PRs (12 files, clippy, 1264 horizon-client tests, parity 76 affected and passing).

On/off (01d0f45, asked by levzzz5154):

  • A native mod's row in Options > Mods now toggles. The mod is on until turned off.
  • Off writes mod.<id>:false to horizon-mods.txt. That is the file and line the launcher reads, so its next Build leaves the mod out. Until then the mod rests: the new helper native_on(id) returns false, and the official mods check it in every hook.
  • On again writes mod.<id>:true.
  • A leftover WebAssembly .hmod of the same id is no longer listed beside the native row.
  • Tests: mod_list::tests::toggles_installed_and_native_mods_but_not_dev_ones; clippy clean.

🤖 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/3346 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/native-mod-settings` --- ### 📝 Commits (2) - [`1149c92`](https://github.com/horizon-rust/horizon/commit/1149c92cb8c1fde5136197b6647a6eb220401a60) Native mods: a settings page in Options > Mods - [`01d0f45`](https://github.com/horizon-rust/horizon/commit/01d0f45c2d08d2b7686a3c44b02f574a3df72542) Native mods: turn one off in Options > Mods ### 📊 Changes **6 files changed** (+237 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/mods.rs` (+11 -1) 📝 `crates/horizon-client/src/game/native_hooks.rs` (+76 -1) 📝 `crates/horizon-client/src/game/options.rs` (+1 -0) 📝 `crates/horizon-client/src/game/startup_menu.rs` (+1 -1) 📝 `crates/horizon-client/src/mod_list.rs` (+69 -16) 📝 `crates/horizon-client/src/options_ui.rs` (+79 -3) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Stacked on #3345 (hook points). This gives native mods their own **settings page** in Options > Mods, so the official mods keep the settings players had with the WebAssembly versions. - **Hooks** `native_mods` (id, title, description, keys), `native_settings` (the page's button labels) and `native_settings_click`. - **Options > Mods**: - A native mod has a row: always ON, since it is built into the game, with a **Settings** button. - **Mod Settings** page: one row per key (rebinding writes `key.<id>.<name>` in `horizon-mods.txt`, as the WebAssembly mods' keys were kept), then the mod's buttons. A click tells the mod and refreshes the labels. - A WebAssembly mod with the same id as a native one built into the game doesn't start. Its row says "Replaced by its native version". **Proof** (Zoom, FPS Counter, Keystrokes and Minimap applied with horizon-mixins on this branch; offscreen game with horizon-ctl on fresh temporary data): - Options > Mods lists "Zoom 2.0.0: ON" with Settings. - The page shows the key (C, as the player's WebAssembly settings had it) and the three WebAssembly labels. - Clicks wrote `level=10`, `smooth=true` and key X into the same files. - FPS Counter's page shows "Corner: Bottom right" and "Minimum and 1% low: ON" from the player's files. - All four together are listed ON. pr_ready: the block on #3345 covers both PRs (12 files, clippy, 1264 horizon-client tests, parity 76 affected and passing). **On/off (01d0f45, asked by levzzz5154):** - A native mod's row in Options > Mods now toggles. The mod is on until turned off. - Off writes `mod.<id>:false` to `horizon-mods.txt`. That is the file and line the launcher reads, so its next Build leaves the mod out. Until then the mod rests: the new helper `native_on(id)` returns false, and the official mods check it in every hook. - On again writes `mod.<id>:true`. - A leftover WebAssembly `.hmod` of the same id is no longer listed beside the native row. - Tests: `mod_list::tests::toggles_installed_and_native_mods_but_not_dev_ones`; clippy clean. 🤖 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 05:08:54 +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#4916
No description provided.