Skip to content

feat(hud): add keybinds to temporarily show or hide HUDs - #1290

Open
Tellinq wants to merge 2 commits into
Polyfrost:v1from
Tellinq:feat/visibility-keybind
Open

Tellinq wants to merge 2 commits into
Polyfrost:v1from
Tellinq:feat/visibility-keybind

Conversation

@Tellinq

@Tellinq Tellinq commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Description

Adds keybinds to quickly show or hide HUDs without changing their saved settings.

Per-HUD visibility keybinds

  • Every HUD's settings in the editor have a new "Visibility Keybind" section with a key, a key mode and a hold threshold.
  • Pressing the key hides the HUD if it's shown, or shows it if it's hidden. The setting the HUD was saved with stays the same.
  • Three modes:
    • Held: only while the key is held down.
    • Toggle: each press switches it.
    • Quick Press: a quick tap switches it. Holding longer than the hold threshold (300 ms by default) switches it back when you let go.
  • The keys don't fire while a menu or chat is open, and they aren't listed in Minecraft's Controls menu, so it doesn't fill up with one entry per HUD.
  • Leaving a world or closing out the game puts every HUD back to its saved state.

Hide All HUDs key

  • New "Hide All HUDs" key, mode and hold threshold in OneConfig's preferences, under a new "HUDs" section.
  • It hides every HUD at once, using the same three modes.
  • If HUDs are hidden this way when you open the HUD editor, a notification explains it and offers a "Show HUDs" button.

HUD editor

  • A HUD a key is currently showing or hiding gets an accent-coloured outline and eye icon. The right-click "Show/Hide" item is also accent-coloured.
  • Using Show/Hide on such a HUD puts it back to its saved state.
  • Switching a HUD on or off in the HUD library also clears any temporary state.

For mod developers

  • KeyPressMode and KeyPressState (in api.ui.v1.keybind) hold the Held / Toggle / Quick Press logic so other mods can reuse it.
  • Hud.visibilityKeyInput(down) lets a HUD be shown and hidden by some other key, for example vanilla's player list key. Such a HUD overrides hasVisibilityKeybind() to hide its own key setting.
  • Hud.drawsWhileHidden() lets a HUD keep drawing after it's hidden, for example to finish a closing animation.
  • Hud.hudEnabled controls what the HUD library's on/off switch changes. It defaults to "not hidden".
  • HudManager.tabListVisibility lets a mod tell OneConfig when the tab list is really open. Every HUD's "Show in Tab" setting uses it.

Checklist

  • I made a clear description of what was changed
  • I stated why these changes were necessary
  • I updated documentation or said what needs to be updated
  • I made sure these changes are backwards compatible
  • This pull request is for one feature/bug fix

@lunaynx
lunaynx force-pushed the feat/visibility-keybind branch 2 times, most recently from e55c2bc to 426da77 Compare November 3, 2026 02:46
lunaynx
lunaynx previously requested changes Nov 3, 2026

@lunaynx lunaynx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a full review, that will be done later.

@Tellinq
Tellinq force-pushed the feat/visibility-keybind branch 2 times, most recently from a11123a to 31882a1 Compare November 3, 2026 03:29
@lunaynx
lunaynx dismissed their stale review November 3, 2026 03:47

Resolved

@Tellinq
Tellinq force-pushed the feat/visibility-keybind branch from 31882a1 to 819cf9b Compare November 4, 2026 01:28
@Tellinq
Tellinq force-pushed the feat/visibility-keybind branch from 819cf9b to 1d94264 Compare November 4, 2026 22:54
@Tellinq
Tellinq requested a review from lunaynx November 4, 2026 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants