Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed isPlayerHudComponentVisible not working with showhud #3634

Conversation

TracerDS
Copy link
Contributor

@TracerDS TracerDS commented Aug 7, 2024

Resolves #547

@@ -43,6 +43,9 @@ void CHudSA::Disable(bool bDisabled)
else
MemPut<BYTE>(FUNC_Draw, 0x80);

for (const auto& component : m_HudComponentMap)
SetComponentVisible(component.first, !IsComponentVisible(component.first));
Copy link
Member

Choose a reason for hiding this comment

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

It looks like isPlayerHudComponentVisible will return true for a hidden component after showhud

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, do you think a copy of the components map would be good here?
To save status of each component and then restore it on the next call

@TheNormalnij
Copy link
Member

TheNormalnij commented Aug 8, 2024

Check conversation in #547.
We need a way to know why a component is hidden.

@qaisjp suggested

bool isPlayerHudComponentVisible(string component, bool checkEnabled=true)

I'd like to keep isPlayerHudComponentVisible only for setPlayerHudComponentVisible.
A new isHudEnabled function can be added instead.

-- returns true by default and false when showhud command is used
bool isHudEnabled()

Both variants are valid.

@tederis tederis added the bugfix Solution to a bug of any kind label Aug 10, 2024
@FileEX
Copy link
Contributor

FileEX commented Oct 4, 2024

Any update?

@TracerDS
Copy link
Contributor Author

Im not interested in advancing this PR further anymore.
If someone wants to refresh it, feel free to do so.

@TracerDS TracerDS closed this Dec 23, 2024
@TracerDS TracerDS deleted the 070824_Fix-isPlayerHudComponentVisible branch December 23, 2024 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Solution to a bug of any kind
Projects
None yet
Development

Successfully merging this pull request may close these issues.

isPlayerHudComponentVisible only works with setPlayerHudComponentVisible
4 participants