Stanzilla / WoWUIBugs

World of Warcraft UI Bug Tracker
153 stars 7 forks source link

Nameplate UnitFrames are combat protected in TWW and cannot be hidden by addons - breaking Nameplate Addons #583

Closed cont1nuity closed 1 week ago

cont1nuity commented 3 weeks ago

Changes made in 11.0 protected the whole nameplate.UnitFrame implicitly and prohibits addons from hiding them.

Running the following while targeting a unit with a nameplate shown indicates the root cause: /dump C_NamePlate.GetNamePlateForUnit("target").UnitFrame:IsProtected() -> true, false /dump C_NamePlate.GetNamePlateForUnit("target").UnitFrame.HealthBarsContainer:IsProtected() -> true, true

image

The namePlateFrameBase.UnitFrame.HealthBarsContainer is new in 11.0 and fully protected from creation through SecureFrameParentPropagationTemplate. Due to how frame protection is inherited upwards the parent structure to the UnitFrame, UnitFrame becomes implicitly protected. Calling namePlateFrameBase.UnitFrame:Hide() in combat is no longer possible for addons, which causes the base nameplate to stay on screen along with the addon nameplate during combat for all nameplates that newly show on screen.

I am unsure if HealthBarsContainer is needed on the nameplate at all or if it needs to be fully protected or parented to the UnitFrame.

Grimsbain commented 2 weeks ago

This also prevents other changes to the frames. My addon made some minor changes to the default nameplates including changing the height to make them a bit bigger but that now no longer works.

hambold commented 2 weeks ago

This also prevents other changes to the frames. My addon made some minor changes to the default nameplates including changing the height to make them a bit bigger but that now no longer works.

I would like to see this changed as well!

Meanwhile as a workaround you can do HealthBarsContainer:ClearAllPoints(), which removes the protection from the healthbar and whatever else is anchored to it. Then you just ignore HealthBarsContainer and anchor your bars to UnitFrame or whatever you want. Luckily, LibGetFrame is returning healthBar and not HealthBarsContainer, so WeakAuras etc wil attach to the correct place, but this is a really sketchy fix.

Hope they clear this protection in the future :|

Meorawr commented 1 week ago

Fixed in 11.0.0.55185.