Fix HUD visibility API and showhud/player map state conflicts#5027
Open
QueryOfficial wants to merge 5 commits into
Open
Fix HUD visibility API and showhud/player map state conflicts#5027QueryOfficial wants to merge 5 commits into
QueryOfficial wants to merge 5 commits into
Conversation
…state #### Summary Updated the IsPlayerHudComponentVisible function to accept an additional parameter, bCheckEnabled, which determines if the HUD's enabled state should be considered when checking component visibility. #### Motivation This change ensures that HUD components are reported as hidden when the HUD is globally disabled, even if they are still enabled by script. This improves the accuracy of visibility checks in various gameplay scenarios. #### Test plan Verify that HUD components behave correctly under different HUD enabled/disabled states, ensuring visibility reflects the actual on-screen status.
#### Summary Introduced a new mechanism for managing HUD visibility through disable reasons, allowing for more granular control over HUD states. The `CHudSA` class now tracks multiple disable reasons, and methods have been added to set and reset these reasons. The `HUD` command function has been updated to respect user preferences without being affected by temporary HUD suppressions. #### Motivation This change improves the handling of HUD visibility, ensuring that temporary states (like player maps) do not interfere with user settings. It enhances the overall user experience by providing a more reliable HUD state management system. #### Test plan Verify that HUD visibility behaves correctly under various scenarios, including toggling the HUD with user commands and during temporary suppressions like player maps.
Contributor
|
You could also add |
…hecks #### Summary This commit refines the HUD management system by introducing a more robust mechanism for handling visibility states. The `CHudSA` class now utilizes suppression reasons to manage temporary HUD states without affecting persistent user preferences. Additionally, new methods have been added to check component visibility more accurately, considering both the global HUD state and individual component states. #### Motivation These changes improve the reliability of HUD visibility, ensuring that temporary suppressions (like player maps) do not interfere with user settings. This enhances the overall user experience by providing clearer and more consistent HUD behavior. #### Test plan Verify that HUD visibility behaves correctly under various scenarios, including toggling the HUD with user commands and during temporary suppressions like player maps. Ensure that component visibility checks reflect the actual on-screen status accurately.
Contributor
Author
2 tasks
Member
|
Conflict with #5028 |
FileEX
requested changes
Jul 22, 2026
#### Summary This commit simplifies the HUD suppression mechanism by removing the use of suppression reasons and directly managing the suppressed state within the `CHudSA` class. The `SetSuppressed` method has been updated to reflect this change, and visibility checks for HUD components have been enhanced to ensure accurate rendering based on the current HUD state. #### Motivation These changes streamline the HUD management system, making it easier to control visibility without the complexity of multiple suppression reasons. This improves the overall reliability of HUD behavior during gameplay. #### Test plan Verify that HUD visibility functions correctly under various scenarios, including toggling the HUD and during temporary suppressions like player maps. Ensure that component visibility checks accurately reflect the current state of the HUD.
Contributor
Author
|
Thanks for the review @FileEX — applied your feedback:
|
FileEX
reviewed
Jul 23, 2026
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.
Summary
This PR fixes two related HUD issues discovered while resolving #5026:
Under the hood this introduces owner-aware HUD visibility state:
There are no Lua function signature breaks, component ID, network protocol, or migration changes. The OOP variant (player.isHudComponentVisible) supports the new parameter automatically.
Motivation
Fixes #5026.
Fixes #547.
isPlayerHudComponentVisible("radar") returned true after showhud hid the HUD, because it only inspected the per-component state set by setPlayerHudComponentVisible and ignored the global HUD draw state.
This problem has a long history, and previous attempts were closed specifically because they changed the default return value:
bool isPlayerHudComponentVisible(string component, bool checkEnabled = true), with the default documented as checking the enabled state.This PR implements the solution the maintainers converged on in those discussions: the default stays fully compatible, and the effective visibility is available on request via checkEnabled = false.
While fixing the API, a second issue was found and fixed: showhud and the fullscreen player map both called Disable(bool) on a single global flag, so for example after showhud 0, opening and closing the F11 map unintentionally re-enabled the HUD. Persistent requested visibility and temporary suppression are now tracked separately, and each owner releases only its own suppression.
Test plan
Build:
API behavior:
State ownership:
Checklist