Eymistaken's HUD 1.1.1-8
Curse Maven Snippet
What's new
This release is API only. Plugin modules can now split their settings page into tabs of
their own. Nothing changes for players: a HUD built from the same modules looks and
behaves exactly as it did in 1.1.1-7.
Full reference: https://eymistaken.github.io/Eymistaken-s-HUD-Website/api-guide.html
---
## Tabs on a plugin module's settings page
`HudModule.getSettingsTabs()` returns a list of `SettingsTab(id, name, settings)`, and
each entry becomes a tab on that module's page alongside the POSITION tab the screen
builds from the module's anchor, offsets and scale. It defaults to an empty list, so a
module that does not override it keeps the flat SETTINGS tab it has today, down to the
ids the screen uses to track per-row state.
Declaring tabs does not discard the two existing setting lists. `getContextMenuSettings()`
leads the first tab, which preserves the rule that everything on the editor's right-click
menu also appears on the page, and `getSettingsScreenSettings()` becomes a trailing
SETTINGS tab.
Tabs with nothing to show are dropped rather than drawn empty, and duplicate tab ids —
including a module claiming the reserved `pos` or `settings` — are renumbered so no tab
becomes unselectable. A module that throws from `getSettingsTabs()` or returns nulls
falls back to the flat layout instead of taking the settings screen down with it.
Opening a module's settings from the HUD editor previously looked for a tab literally
named `settings`, which a module with its own tabs need not have; it now lands on the
first non-placement tab. Built-in module pages are unaffected.
This mod has no additional files