Remove default health bar in 10.5?

Has anyone figured out how to remove the default health bar texture in 10.5 yet?

I’m using my own frames for player and target and since 10.5 came out the code I was using to hide the texture doesn’t work anymore for player and target. And I’m only trying to hide the texture because I still use the default text for it. I can hide the whole bar but it will remove the text also if I do. I’m not sure what changed either for me to fix the code. Any help on this topic would be appreciated. Thank you fellow add-on developers!

Would probably help if you posted the code that was working prior to 10.0.5

Sure np

PlayerFrame.PlayerFrameContent.PlayerFrameContentMain.HealthBarArea.HealthBar:DisableDrawLayer("ARTWORK")

Hmm… PlayerFrame.lua and PlayerFrame.xml weren’t modified in 10.0.5 so the structure’s still the same, nor was SimpleFrameAPIDocumentation.lua where the DisableDrawLayer function is from.
Landed on an older commit by mistake. They were updated.

This works

/run PlayerFrame.PlayerFrameContent.PlayerFrameContentMain.HealthBarArea.HealthBar:DisableDrawLayer("BACKGROUND")
2 Likes

It looks like in 10.0.5 the StatusBar has a drawLayer attribute which is interesting, for BACKGROUND.

In 10.0.2:

<StatusBar parentKey="HealthBar" inherits="TextStatusBar">

In 10.0.5:

<StatusBar parentKey="HealthBar" inherits="TextStatusBar" drawLayer="BACKGROUND">

I wonder if it’s like a childKey for masks. I’d not seen it there before.

And as Elvenbane points out, using BACKGROUND instead of ARTWORK seems to remove it.

2 Likes

Thank you Elvenbane that did work!
And Gello! maybe this could work on your adapt add-on to improve it? So instead of adding the frame on top of the portrait you could remove the default portrait and add your own as the new portrait to the background or wherever it’s set to? For the code that doesn’t have a purpose. Lol I still remember that. :joy: