View Single Post
07-16-12, 08:04 AM   #93
Jarod24
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jul 2012
Posts: 66
Originally Posted by Haleth View Post
They use new functions and events entirely.

https://github.com/Ketho/wow-ui-sour...etBattleUI.lua

Code:
PET_BATTLE_PET_CHANGED
PET_BATTLE_MAX_HEALTH_CHANGED
PET_BATTLE_HEALTH_CHANGED
Code:
C_PetBattles.GetHealth(petOwner, petIndex)
petOwner and petIndex are table entries of the unit frame in question, e.g. PetBattleFrame.BottomFrame.PetSelectionFrame.Pet1.
Hm, too bad. All i really wanted was a nice simple way to ask about pet health at any time.
If the petbattleframe isnt visible/loaded then this will not work.
If i manually target my pet and use UnitHealth("target") then it returns the value.
Why would they not add a simple unitid-string that could be used aswell instead of having us go via the UI.