BodyguardHealth

BodyguardHealth

95.4k Downloads

Enhancement: Hide frame when status is unknown or inactive

b-morgan opened this issue · 6 comments

commented

I'd suggest that BGH hide the frame when the status is unknown or inactive. You can't interact with the frame (yet) so it doesn't need to be seen unless it has something to say!

commented

The frame should hide itself whenever the status is Inactive. In what situation does it not?

For unknown status, I opted to have it shown as the status is unknown and the bodyguard might be there (typically when logging in with an active bodyguard).

I'm working on the right click menu at the moment which should make the "show when unknown" more bearable with the option to hide the frame from the menu.

commented

Being more observant now, if I logged out in my garrison with a bodyguard active, when I login the frame says 100% and Unknown. As soon as combat starts (one of those annoying creatures that pop up in the garrison), bodyguard status changes to Active and at the end of the fight, returns to 100%.

commented

The health issue seems to be related to LibBodyguard sending a health update on login (with 0 health since the library hasn't collected any health information yet). This update overrides the saved value in BodyguardHealth. I'll add some checks to make sure the values aren't overridden when BodyguardHealth has saved health values from last session.

commented

I can delay the initial health update pushed by the lib, preventing the 0% or white health bar on login. It does simply push the issue further ahead though. There is no (at least that I have discovered) reliable way to get bodyguard health without the player interacting with it in some way. So as soon as the bodyguard gets hit by something, the health will go to 0% unless it has been interacted with to let the library update the health values (mouseover is enough).

Most of the time, due to the proximity to the player, the bodyguard gets mouse overed at least once, so it's usually not an issue. But it could be when logging out near mobs and going into combat shortly after logging in. Not sure if there's a good way to fix that though.

From my own usage, I've found that mousing over the bodyguard is relatively painless to update it if I notice the health is clearly bugged, but it would be better if it could be detected in some other way too.

commented

I’ll keep an eye on what causes the frame to still show when Inactive is displayed. I’m going to make a wild guess that it has something to do with bodyguard dead, logoff within the one hour cooldown, log in later (probably after the cooldown has expired). When I get a better scenario, I’ll add another comment.

commented

BTW, I’m OK with your explanation for Unknown, although if the bodyguard is present, the frame doesn’t convey any information (i.e. health is white) until something allows BGH to determine the health status (which changes Unknown to something else).