oUF

97.2k Downloads

Player nameplate shows Blizzard power bar and special resources

Adirelle opened this issue ยท 11 comments

commented

Describe the bug
Blizzard power bar and resource widget are displayed along the custom nameplate for the player.

How to reproduce

  1. Create and use a nameplate style for oUF that does not display power bar nor special resources.
  2. Check "personal resource display" in Blizzard interface settings (Names tab).
  3. Select a target, or enter in combat so the player nameplate is shown.

What did you expect?
A customized nameplate without power bar nor special resource.

Error report
None

Screenshots
image

Please note that enabling "Show special resource on target" move the special resource on the target nameplate.

commented

@siweia has the best answer to this, closing it with an example:

oUF:SpawnNamePlates(nil, nil, {nameplateShowSelf = '0'})

Then spawn a normal "player" unit with oUF:Spawn('player') to replace the personal resource display.

commented

This might be related to #525. However, I am neither messing with Blizzard code nor oUF one/.

In its current version, oUF does not hide Blizzard frames (ClassNameplate*) for the unit "player", see ClassNameplate files in https://github.com/Gethe/wow-ui-source/tree/live/AddOns/Blizzard_NamePlates

commented

I am using the same kind of workaround. I have got no tainting errors so far.

IMO the current behavior is a bit misleading. Some additional doc about SpawnNameplates could be sufficient. My apologies if they existed and I have overlooked them.

commented

@Adirelle nah, nah, all good and I agree. I was the one wrote all that bs anyway, so it's on me. I'll talk to other guys about adding the option I mentioned.

commented

It's not a bug. We do so to avoid messing with forbidden nameplates in dungeons, they still use the same insecure class power widgets, at least they used to, there's some changes in either BfA or SL, but I haven't checked it yet ๐Ÿ˜…. It's also opens up an option of repurposing default class power widgets instead of creating your own. So if a user wants to disable Blizz widgets, they should do it themselves, something like this should do the trick.

if(NamePlateDriverFrame.classNamePlatePowerBar) then
	NamePlateDriverFrame.classNamePlatePowerBar:Hide()
	NamePlateDriverFrame.classNamePlatePowerBar:UnregisterAllEvents()
end

hooksecurefunc(NamePlateDriverFrame, 'SetupClassNameplateBars', function(nameplate)
	if(not nameplate or nameplate:IsForbidden()) then
		return
	end

	if(nameplate.classNamePlateMechanicFrame) then
		nameplate.classNamePlateMechanicFrame:Hide()
	end

	if(nameplate.classNamePlatePowerBar) then
		nameplate.classNamePlatePowerBar:Hide()
		nameplate.classNamePlatePowerBar:UnregisterAllEvents()
	end
end)

I used to run something similar myself, not sure if it still works. I could possibly add it as an option to oUF:SpawnNamePlates, something like disableBlizzPower toggle, but idk. Please, tell me if it still works and doesn't break anything, and then I'll discuss it with the boys :D

commented

There is something funny.

My master branch causes tainting, but my last tag does not. Between the two, I mainly removed all shadowing of globals: Adirelle/oUF_Adirelle@9.0-1.1.0-beta-4...master

commented

It seems it still cause tainting.

Edit: nope. I have removed the code and something is still tainting the nameplates. So it might be something else I changed recently.

commented

Oh, yeah, that's the other one T_T I don't remember what's causing it tho.

commented

It is one of these by any chance?

1x ...eBlizzard_NamePlates\Blizzard_NamePlates.lua:470: Action[FrameMeasurement] failed because[Can't measure restricted regions]: attempted from: <unnamed>:GetLeft().

You can get it even without a single nameplate addon, seems like a generic API taint.

commented

Nope, something about calling SetTargetClampingInsets, line 305 of Blizzard_NamePlates/Blizzard_NamePlates.lua

Curiously, it goes away when I revert my changes and upvalue all the globals ; I have a script that automates it. I am wondering if another addon is somehow involved.

commented

It is much more easier to just disable system player plate by cvar or game option, then create another player frame and make it looks like a player plate, which you don't need to worry about taint.