Skip to content

feat: a HUD display can change its layout after it registers - #1331

Merged
vdmkenny merged 1 commit into
mainfrom
feat/display-layout-changes
Oct 23, 2026
Merged

vdmkenny merged 1 commit into
mainfrom
feat/display-layout-changes

Conversation

@vdmkenny

Copy link
Copy Markdown
Collaborator

A display's layout and parts were fixed when it registered. A display whose layout depends on the window, such as the Recommissioned HUD fitting the radio's window into its own frame, had to register a new display each time the window changed, and stopped following it past 24 registrations.

  • hud.set_display_layout(name, { layout = ..., parts = ... }) replaces a display's layout and parts, with the checks register_display makes. A field left out stays as it was, and a mistake changes nothing.
  • It takes the calling mod's display by its own name, or any mod's by the qualified one, and returns whether the display is registered, as set_display_enabled does.
  • As before, the instruments go back as they were as soon as the display is turned off, fails or its mod stops.
  • The scripting guide, the reference and the definitions say so.

Checked with a new test: a display moves the clock after it registers and keeps its parts, a bad layout changes nothing, and other names come back false.

Closes #1028

A display's layout and parts were fixed when it registered, so a display
whose layout depends on the window, as the Recommissioned HUD fits the
radio's window into its frame, had to register a new display each time
the window changed, and stopped following it past 24.

hud.set_display_layout(name, { layout = ..., parts = ... }) replaces a
display's layout and parts with the checks register_display makes: a
field left out stays as it was, and a mistake changes nothing. They go
back as they were as soon as the display is turned off, fails or its mod
stops, as before.
@vdmkenny
vdmkenny merged commit c8b34f2 into main Oct 23, 2026
4 checks passed
@vdmkenny
vdmkenny deleted the feat/display-layout-changes branch October 23, 2026 22:42
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.

HUD displays can change their layout after registering

1 participant