oUF

97.2k Downloads

Nameplates ClassPower display inconsistent

Wutname1 opened this issue ยท 5 comments

commented

I am attempting to show the Classpower on the players nameplate. I have a feeling I am missing something simple but i just can't seem to find it or I have ran into a bug.

When I add the ClassPower element to the nameplates factory it will show up on the players nameplate the first time and only work if that frame remains the players nameplate. If it becomes a target nameplate it will show what ever combo points the player had at the time of it no longer being the players nameplate. It will not update or go away. The players new nameplate will not show the combo points at all.

I tried to Enable/Disable the element via the callback on SpawnNamePlates the callback is calling the proper Enable/Disable on the proper nameplate. Just like before the combo points are only working on the first nameplate to be flagged as the player. Once the players nameplate becomes a target nameplate the combo points are hidden as you would expect so the disable call is functioning properly. The new Player nameplate however never starts to display the players combo points. With one exception, I can get the new player nameplate to display the ClassPower if the player is a druid. Once the players nameplate is shown shapeshifting causes the ClassPower bars to function. Due to this to me it seems like there is a issue with the OnEnable for ClassPower.

Callback code used for testing:

print(self:GetName())
if UnitIsUnit(unit, 'player') and event == 'NAME_PLATE_UNIT_ADDED' then
	print('EnableElement')
	self:EnableElement('ClassPower')
else
	print('DisableElement')
	self:DisableElement('ClassPower')
end
commented

See #448.

commented

I am running the PR with the exception of b4e671c Here is what i have merged in from the PR: https://github.com/Wutname1/oUF/pull/1

commented

Did you try adding self.ClassPower:ForceUpdate() after self:EnableElement('ClassPower')?

commented

self.ClassPower:ForceUpdate() did it. I had tried it last night but I think I mistakenly typed self.ClassPower.ForceUpdate()

Is it expected to need to force an update after an enable, should'int the enable call be calling an update?

commented

Yes, that is expected of the layout to handle.