Thread Tools Display Modes
Prev Previous Post   Next Post Next
02/22/14, 01:14 AM   #1
Capadillo
Join Date: Feb 2014
Posts: 12
Post Creating AddOns w/o BETA Access

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:
  1. local assocFrame = {
  2.     "player" = {
  3.         POWERTYPE_HEALTH  = "playerHealthBar",
  4.         POWERTYPE_MAGICKA = "playerMagickaBar",
  5.         POWERTYPE_STAMINA = "playerStaminaBar",
  6.     },
  7.     "target" = {
  8.         POWERTYPE_HEALTH  = "targetHealthBar",
  9.         POWERTYPE_MAGICKA = "targetMagickaBar",
  10.         POWERTYPE_STAMINA = "targetStaminaBar",
  11.     },
  12. }
  13.  
  14. local barWidth, barHeight = 200, 20
  15.  
  16. local function eventUpdatePower(unit, powerType, powerCurrent, powerMax)
  17.     local statusBar = assocFrame[unit][powerType]
  18.     if not powerCurrent or not powerMax then
  19.         powerCurrent, powerMax = GetUnitPower(unit, powerType)
  20.     end
  21.     statusBar:SetDimensions(( powerCurrent / powerMax ) * barWidth, barHeight)
  22. 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

Last edited by Capadillo : 02/22/14 at 06:54 AM.
  Reply With Quote
 

ESOUI » Developer Discussions » General Authoring Discussion » Creating AddOns w/o BETA Access


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off