HUD component visibility state handling#5028
Open
HeresHavi wants to merge 1 commit into
Open
Conversation
Implemented owner-aware HUD visibility: - `showhud` and the full-screen map no longer overwrite each other’s state. - `isPlayerHudComponentVisible` now respects global HUD visibility. - Radar child components respect the main radar’s state. - Reset behavior clears stale map/HUD state. - No migration, network, or component-ID changes. - Formatting, project generation, and source-level checks passed. - Nothing was staged, committed, or pushed; runtime testing remains.
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
Updated
isPlayerHudComponentVisibleto report whether a HUD component can actually be drawn, including the globalshowhudstate and fullscreen map suppression.Radar child components now follow the parent radar state without losing their own visibility settings.
Motivation
Previously,
isPlayerHudComponentVisibleonly checked the state of the requested component. This meant the radar could be hidden byshowhudwhile the function still returnedtrue.The fullscreen player map also used the same global HUD state. Closing the map could re-enable a HUD that the player had already hidden with
showhud.For example, a resource might display a custom minimap only while the GTA radar is hidden. If the API incorrectly reports that the radar is still visible, the resource cannot reliably decide when to show its replacement.
Fixes #5026.
Test plan
Runtime
showhudhid the radar, butisPlayerHudComponentVisible("radar")still returnedtrue.falsewhile the HUD was hidden and returnedtrueafter restoring it.showhud, and restoring the HUD kept the radar hidden until it was explicitly restored.showhud.radar_map,radar_blips, andradar_altimeterfollowed the parent radar state while keeping their own visibility settings.Builds and Tests
Debug | Win32: Client build passed.Release | Win32: Client build passed.clang-format.Checklist