I am looking at creating a UnitFrame addon for ESO when it comes out, and I would like some assistance from programmers (either in, or out of PTS testing) to make sure I am close to the mark.
Lua Code:
local assocFrame = {
"player" = {
POWERTYPE_HEALTH = "playerHealthBar",
POWERTYPE_MAGICKA = "playerMagickaBar",
POWERTYPE_STAMINA = "playerStaminaBar",
},
"target" = {
POWERTYPE_HEALTH = "targetHealthBar",
POWERTYPE_MAGICKA = "targetMagickaBar",
POWERTYPE_STAMINA = "targetStaminaBar",
},
}
local barWidth, barHeight = 200, 20
local function eventUpdatePower(unit, powerType, powerCurrent, powerMax)
local statusBar = assocFrame[unit][powerType]
if not powerCurrent or not powerMax then
powerCurrent, powerMax = GetUnitPower(unit, powerType)
end
statusBar:SetDimensions(( powerCurrent / powerMax ) * barWidth, barHeight)
end
I am reading through some existing addons, but actually getting info straight from you guys would be much better.
EDIT: I am assuming that "EVENT_POWER_UPDATE" will return all of the information for updating the individual powers as well, so we would only need to use "GetUnitPower" to force an update, or during login?
EDIT2: Updated the code...
EDIT3: Thank you for moving. I completely missed the dev forums. :3