Skip to content

refactor(omsi-app): AP3 step 2, the hit rectangles out of Ui into hud::Hits - #551

Merged
ZaneThurston merged 1 commit into
mainfrom
feat/app-hud-hits
Oct 28, 2026
Merged

ZaneThurston merged 1 commit into
mainfrom
feat/app-hud-hits

Conversation

@ZaneThurston

@ZaneThurston ZaneThurston commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Zane

Track App, AP3 step 2 (docs/OMSI_APP_REFACTOR.md, tracked in #61). Move-only.

What changes

  • The twenty fields of the old drawing's Ui that say where the menu's parts and the information bar were drawn move to hud/domain/hits.rs as Hits. These are menu_rects, menu_ctl, menu_side, menu_pane*, menu_time, menu_start/menu_rows/menu_row_h, the scroll bars, dd_* and info_rect.
  • Ui holds them as ui.hits, and Hits::default() keeps the old starting values (dd_rows 8, menu_row_h 1).
  • Shifting the rectangles for one panel of a spanning window becomes Hits::shift. Ui::shift_hitboxes calls it and still moves the chat box.
  • PageFrame::write_hits (the new menu pages) now takes &mut Hits instead of &mut hud::Ui, so the new interface no longer needs the old drawing to report its rectangles. This is what AP3 needs before the new_ui*.rs files move to ui/.
  • Callers read ui.hits.<field>: the mouse, the keyboard, touch, the actions, the frame in app_events.rs, and the tests.

The overlay indices (menu_overlay_range, vr_cursor_overlay, vr_tooltip_overlay) stay in Ui, because they belong to the drawing.

The commit message calls the method NewMenuPage::write_hits. The type is PageFrame.

Checks

  • cargo test -p omsi-app --lib --test app, with all features (845 passed, 17 ignored) and without features (805 passed, 16 ignored).
  • The list of test names is the same as on main.
  • The lib warnings without features are the same as on main.
  • No access to these fields is left outside hits., including the Windows-only files, which were checked by search because they don't compile on Linux.
  • cargo fmt was run on the touched files only.

Generated by Claude Code

AP3 step 2. The twenty fields of `Ui` that say where the menu's parts and
the information bar were drawn (`menu_rects`, `menu_ctl`, `menu_side`,
`dd_rects`, ...) move to `hud/domain/hits.rs` as `Hits`, held by `Ui` as
`ui.hits`. Their shift for a panel of a spanning window becomes
`Hits::shift`; `Ui::shift_hitboxes` calls it and still moves the chat.

`NewMenuPage::write_hits` now takes `&mut Hits`, so the new menu pages no
longer need the old drawing's `Ui`. Callers read `ui.hits.<field>`.
No behaviour change: the same tests and the same lib warnings as main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ZaneThurston ZaneThurston self-assigned this Oct 28, 2026
@ZaneThurston ZaneThurston mentioned this pull request Oct 28, 2026
34 of 39 tasks
@ZaneThurston
ZaneThurston merged commit 1737d17 into main Oct 28, 2026
7 checks passed
@ZaneThurston
ZaneThurston deleted the feat/app-hud-hits branch October 29, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants