Repository navigation
refactor(omsi-app): AP3 step 2, the hit rectangles out of Ui into hud::Hits - #551
Merged
Merged
Conversation
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>
34 of 39 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Zane
Track App, AP3 step 2 (
docs/OMSI_APP_REFACTOR.md, tracked in #61). Move-only.What changes
Uithat say where the menu's parts and the information bar were drawn move tohud/domain/hits.rsasHits. These aremenu_rects,menu_ctl,menu_side,menu_pane*,menu_time,menu_start/menu_rows/menu_row_h, the scroll bars,dd_*andinfo_rect.Uiholds them asui.hits, andHits::default()keeps the old starting values (dd_rows8,menu_row_h1).Hits::shift.Ui::shift_hitboxescalls it and still moves the chat box.PageFrame::write_hits(the new menu pages) now takes&mut Hitsinstead of&mut hud::Ui, so the new interface no longer needs the old drawing to report its rectangles. This is what AP3 needs before thenew_ui*.rsfiles move toui/.ui.hits.<field>: the mouse, the keyboard, touch, the actions, the frame inapp_events.rs, and the tests.The overlay indices (
menu_overlay_range,vr_cursor_overlay,vr_tooltip_overlay) stay inUi, because they belong to the drawing.The commit message calls the method
NewMenuPage::write_hits. The type isPageFrame.Checks
cargo test -p omsi-app --lib --test app, with all features (845 passed, 17 ignored) and without features (805 passed, 16 ignored).main.main.hits., including the Windows-only files, which were checked by search because they don't compile on Linux.cargo fmtwas run on the touched files only.Generated by Claude Code