[PR #145] [MERGED] Controllers: Controller options, button binds and glyphs #2353

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

📋 Pull Request Information

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

Base: main ← Head: feat/controllers-options


📝 Commits (3)

  • ce85fd9 Controllers: Controller options, button binds and glyphs
  • e8ca05a Controllers: deadzone percentages rounded
  • 32bb361 Controllers: × for the PlayStation cross (the game fonts lack ✕)

📊 Changes

8 files changed (+367 additions, -4 deletions)

View changed files

📝 crates/horizon-client/src/game/control.rs (+2 -0)
📝 crates/horizon-client/src/game/options.rs (+1 -1)
📝 crates/horizon-client/src/game/pad.rs (+1 -0)
📝 crates/horizon-client/src/game/pad_menu.rs (+11 -0)
📝 crates/horizon-client/src/gamepad.rs (+102 -0)
📝 crates/horizon-client/src/options_horizon.rs (+25 -1)
📝 crates/horizon-client/src/options_ui.rs (+224 -1)
📝 docs/controllers.md (+1 -1)

📄 Description

Part 3 of controller support (design: docs/controllers.md). Follows #129 (merged; binds are captured through its menu cursor).

What

  • Controller settings (Horizon's own, saved in horizon-controller.txt; options.txt untouched):
    • Classic menus: Controls → "Controller Settings..." page (vanilla's rows stay as they are, the button is added after them): Controller on/off, Vibration, Look Sensitivity, Sneak Button (Toggle/Hold), Invert Look X/Y, Move and Look Deadzone, Button Glyphs (Auto / Xbox / PlayStation / Nintendo), and "Controller Binds...".
    • Horizon menus: a "Controller" group in the Controls section with the same rows (switches/sliders/value buttons) and a "Controller binds" page row.
  • Remapping: "Controller Binds" lists every bindable action (vanilla key mappings + Horizon's hotbar previous/next) like Key Binds: pick a row, press a pad button to bind it (Start cancels; Escape on the keyboard unbinds; a click cancels), per-row Reset, Reset all, and conflicts in yellow brackets as vanilla marks key conflicts. Only binds that differ from the defaults are written (bind_<action>:<button>).
  • Glyphs: Button::label / Button::color per family: Xbox (A B X Y in green/red/blue/yellow, LB RB LT RT, View, Menu), PlayStation (× ○ □ △ in their colours; ✕ is missing from the game fonts, L1 R1 L2 R2, Create, Options), Nintendo (B A Y X by position). Drawn by Horizon with the game font (✕○□△ and arrows come from the Unifont fallback); no Mojang assets. Auto picks the family from the active pad's USB vendor.
  • horizon-ctl options controller / options controller-binds open the pages.

How tested

  • Unit test gamepad::tests::labels_and_conflicts; clippy and fmt clean (macOS); the whole client lib suite passes except save::tests::session_lock_is_exclusive, which failed once in a parallel run and passes alone (unrelated).
  • Linux build on vscreen with horizon-ctl pad: Controller Binds shows coloured Xbox glyphs; A on "Drop" then X binds Drop to X: both rows turn yellow-bracketed, Reset lights up, and horizon-controller.txt gets bind_key.drop:west only. The Controller Settings page shows all rows; with glyphs:playstation the binds list shows ✕ ○ □ △ / L1 R1 L2 R2.
  • Not tested with a real controller (vendor auto-detection of the glyph family in particular).

🤖 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/145 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/14/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/controllers-options` --- ### 📝 Commits (3) - [`ce85fd9`](https://github.com/horizon-rust/horizon/commit/ce85fd98edaa437a55107ded24d9d1e5b9ff5457) Controllers: Controller options, button binds and glyphs - [`e8ca05a`](https://github.com/horizon-rust/horizon/commit/e8ca05af19d5e924e71ae85e1c58b38b2768edd2) Controllers: deadzone percentages rounded - [`32bb361`](https://github.com/horizon-rust/horizon/commit/32bb3612fbe9769c79331220478637be2e7a5261) Controllers: × for the PlayStation cross (the game fonts lack ✕) ### 📊 Changes **8 files changed** (+367 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/control.rs` (+2 -0) 📝 `crates/horizon-client/src/game/options.rs` (+1 -1) 📝 `crates/horizon-client/src/game/pad.rs` (+1 -0) 📝 `crates/horizon-client/src/game/pad_menu.rs` (+11 -0) 📝 `crates/horizon-client/src/gamepad.rs` (+102 -0) 📝 `crates/horizon-client/src/options_horizon.rs` (+25 -1) 📝 `crates/horizon-client/src/options_ui.rs` (+224 -1) 📝 `docs/controllers.md` (+1 -1) </details> ### 📄 Description Part 3 of controller support (design: `docs/controllers.md`). Follows #129 (merged; binds are captured through its menu cursor). ## What - **Controller settings** (Horizon's own, saved in `horizon-controller.txt`; `options.txt` untouched): - Classic menus: Controls → "Controller Settings..." page (vanilla's rows stay as they are, the button is added after them): Controller on/off, Vibration, Look Sensitivity, Sneak Button (Toggle/Hold), Invert Look X/Y, Move and Look Deadzone, Button Glyphs (Auto / Xbox / PlayStation / Nintendo), and "Controller Binds...". - Horizon menus: a "Controller" group in the Controls section with the same rows (switches/sliders/value buttons) and a "Controller binds" page row. - **Remapping**: "Controller Binds" lists every bindable action (vanilla key mappings + Horizon's hotbar previous/next) like Key Binds: pick a row, press a pad button to bind it (Start cancels; Escape on the keyboard unbinds; a click cancels), per-row Reset, Reset all, and conflicts in yellow brackets as vanilla marks key conflicts. Only binds that differ from the defaults are written (`bind_<action>:<button>`). - **Glyphs**: `Button::label` / `Button::color` per family: Xbox (A B X Y in green/red/blue/yellow, LB RB LT RT, View, Menu), PlayStation (× ○ □ △ in their colours; ✕ is missing from the game fonts, L1 R1 L2 R2, Create, Options), Nintendo (B A Y X by position). Drawn by Horizon with the game font (✕○□△ and arrows come from the Unifont fallback); no Mojang assets. Auto picks the family from the active pad's USB vendor. - `horizon-ctl options controller` / `options controller-binds` open the pages. ## How tested - Unit test `gamepad::tests::labels_and_conflicts`; clippy and fmt clean (macOS); the whole client lib suite passes except `save::tests::session_lock_is_exclusive`, which failed once in a parallel run and passes alone (unrelated). - Linux build on vscreen with `horizon-ctl pad`: Controller Binds shows coloured Xbox glyphs; A on "Drop" then X binds Drop to X: both rows turn yellow-bracketed, Reset lights up, and `horizon-controller.txt` gets `bind_key.drop:west` only. The Controller Settings page shows all rows; with `glyphs:playstation` the binds list shows ✕ ○ □ △ / L1 R1 L2 R2. - **Not tested with a real controller** (vendor auto-detection of the glyph family in particular). 🤖 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:55:15 +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#2353
No description provided.