WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   WoD Beta archived threads (https://www.wowinterface.com/forums/forumdisplay.php?f=151)
-   -   PTR 6.2.2 Nameplate changes (https://www.wowinterface.com/forums/showthread.php?t=52640)

Blazeflack 08-21-15 11:55 AM

PTR 6.2.2 Nameplate changes
 
The nameplates have received some updates on the PTR recently.

From this thread you had the following code:
Code:

    --full nameplate objects
        local f = NamePlate1 --nameplateframe
        f.barFrame, f.nameFrame = f:GetChildren()
        f.barFrame.threat, f.barFrame.border, f.barFrame.highlight, f.barFrame.level, f.barFrame.boss, f.barFrame.raid, f.barFrame.dragon = f.barFrame:GetRegions()
        f.nameFrame.name = f.nameFrame:GetRegions()
        f.barFrame.healthbar, f.barFrame.castbar = f.barFrame:GetChildren()
        f.barFrame.healthbar.texture =  f.barFrame.healthbar:GetRegions()
        f.barFrame.castbar.texture, f.barFrame.castbar.border, f.barFrame.castbar.shield, f.barFrame.castbar.icon =  f.barFrame.castbar:GetRegions()

The folllowing line will need to be changed if you want to stick with this code:
Code:

f.barFrame.healthbar, f.barFrame.castbar = f.barFrame:GetChildren()
to this:
Code:

f.barFrame.healthbar, f.barFrame.absorbBar, f.barFrame.castbar = f.barFrame:GetChildren()

In addition to the above change, almost all elements have received parentKeys.
You can now use the following code instead:
Code:

local frame = NamePlate1

frame.name = frame.NameContainer.NameText
frame.border = frame.ArtContainer.Border
frame.highlight = frame.ArtContainer.Highlight
frame.level = frame.ArtContainer.LevelText
frame.raidIcon = frame.ArtContainer.RaidTargetIcon
frame.eliteIcon = frame.ArtContainer.EliteIcon
frame.threat = frame.ArtContainer.AggroWarningTexture
frame.bossIcon = frame.ArtContainer.HighLevelIcon

frame.healthBar = frame.ArtContainer.HealthBar
frame.healthBar.texture = frame.healthBar:GetRegions() --No parentKey, yet?
--Available child element (texture): frame.healthBar.OverAbsorb

frame.absorbBar = frame.ArtContainer.AbsorbBar
frame.absorbBar.region1 = frame.absorbBar:GetRegions() --No parentKey, yet? Not sure what region1 is, probably texture like the others.
frame.absorbBar.overlay = frame.absorbBar.Overlay

frame.castBar = frame.ArtContainer.CastBar
frame.castBar.texture = frame.castBar:GetRegions() --No parentKey, yet?
frame.castBar.border = frame.ArtContainer.CastBarBorder
frame.castBar.icon = frame.ArtContainer.CastBarSpellIcon
frame.castBar.shield = frame.ArtContainer.CastBarFrameShield
frame.castBar.name = frame.ArtContainer.CastBarText
frame.castBar.shadow = frame.ArtContainer.CastBarTextBG

Quote:

Edit: "OnValueChangd" for healthbars now returns values between 0 and 1. Hopefully this is unintended, as it will make it hard to get exact values for nameplates.

semlar 08-21-15 03:53 PM

Interesting, this should make it simpler to identify the various nameplate regions.

Blazeflack 09-01-15 11:43 AM

It would appear the "OnValueChanged" script on the nameplate healthbars has been changed as well.

It now returns values between 0 and 1, both included.

Supernex 09-01-15 08:27 PM

Which file is this in?

Blazeflack 09-02-15 05:12 AM

Quote:

Originally Posted by Supernex (Post 310675)
Which file is this in?

There is no file. It was manually discovered on the PTR.

Taet 09-02-15 07:34 AM

I please you , anyone who knows how , he could update infinityplate ?

Resike 09-02-15 09:03 AM

Quote:

Originally Posted by Taet (Post 310689)
I please you , anyone who knows how , he could update infinityplate ?

You can download a fan update here:

http://www.wowinterface.com/download...19881#comments

Resike 09-02-15 11:08 AM

Anyone figured out how to porperly show health values and health max values with nameplates now?

Blazeflack 09-02-15 12:27 PM

Quote:

Originally Posted by Resike (Post 310692)
Anyone figured out how to porperly show health values and health max values with nameplates now?

The only way is to use the UnitHealthMax API when you mouse over a nameplate, then cache that value so you can use it later. Multiply the return from healthBar:GetValue() with the cached MaxHealth to get a guesstimate of the current exact health value.

This will obviously lead to examples where the exact value isn't 100% correct, as a player could receive or lose a health buff right after you cached his MaxHealth. In that case you would need to mouse over that player once more to grab the new MaxHealth.

Suffice to say, the current implementation is not ideal. Hopefully Blizzard will correct it sooner rather than later (and preferrably sooner than Soon™)

Resike 09-02-15 12:49 PM

Quote:

Originally Posted by Blazeflack (Post 310696)
The only way is to use the UnitHealthMax API when you mouse over a nameplate, then cache that value so you can use it later. Multiply the return from healthBar:GetValue() with the cached MaxHealth to get a guesstimate of the current exact health value.

This will obviously lead to examples where the exact value isn't 100% correct, as a player could receive or lose a health buff right after you cached his MaxHealth. In that case you would need to mouse over that player once more to grab the new MaxHealth.

Suffice to say, the current implementation is not ideal. Hopefully Blizzard will correct it sooner rather than later (and preferrably sooner than Soon™)

This is retarded. Why the heck they had to do this? How hard is it to calculate the percentages by themselfs?

p3lim 09-03-15 10:58 AM

Quote:

Originally Posted by Resike (Post 310697)
This is retarded. Why the heck they had to do this? How hard is it to calculate the percentages by themselfs?

If all you're after is getting percentages, you can do this:
Code:

local perc = hpBar:GetValue() * 100
someHealthText:SetFormattedText('%.1f%%', perc)

And use HookScript on the health bar's OnValueChanged and OnShow to update it.

Resike 09-03-15 01:51 PM

Quote:

Originally Posted by p3lim (Post 310749)
If all you're after is getting percentages, you can do this:
Code:

local perc = hpBar:GetValue() * 100
someHealthText:SetFormattedText('%.1f%%', perc)

And use HookScript on the health bar's OnValueChanged and OnShow to update it.

Thats not really the issue, the old percentage functions should work fine even unchanged. The real issue here they probably made the change since the default name plates only show percentages, so better to remove any other usefull information about it.

Blazeflack 09-11-15 12:41 PM

The health value issue will be fixed in a future update: https://twitter.com/WarcraftDevs/sta...20808857403392

Resike 09-12-15 04:42 AM

Quote:

Originally Posted by Blazeflack (Post 310924)
The health value issue will be fixed in a future update: https://twitter.com/WarcraftDevs/sta...20808857403392

Nice, but i don't get it why can't they just hotfix it in a wednesday maintenance.

p3lim 09-12-15 06:25 AM

Quote:

Originally Posted by Resike (Post 310936)
Nice, but i don't get it why can't they just hotfix it in a wednesday maintenance.

All UI changes require a patch.

Spyro 09-12-15 09:23 AM

Can we catch nameplates now using if Frame.ArtContainer instead of if Frame:GetName() and Frame:GetName():find("NamePlate") ? Or are there any other children of the WorldFrame with also an "ArtContainer" member?

Blazeflack 09-12-15 12:40 PM

Quote:

Originally Posted by Spyro (Post 310943)
Can we catch nameplates now using if Frame.ArtContainer instead of if Frame:GetName() and Frame:GetName():find("NamePlate") ? Or are there any other children of the WorldFrame with also an "ArtContainer" member?

I don't know if there are other children with that specific element. You would need to test it, but I suspect it might be possible to do it the way you suggest.

Edit: I did a test and only captured Nameplates with the .ArtContainer element.


All times are GMT -6. The time now is 06:25 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI